Sonargraph User Manual

Version 9.4.6


Table of Contents
1. Sonargraph's Next Generation - Sonargraph 9
2. Licensing
2.1. Getting an Activation Code or a License
2.2. Activation Code Based Licensing
2.3. Proxy Settings
2.4. License Server Settings
3. Getting Started
3.1. Installation and Updates
3.2. Help
3.3. Editor Preferences
3.4. C/C++ Compiler Definitions
3.4.1. Failed Generated Compiler Definitions
3.5. C# Configuration
3.5.1. C# Build Executor Configuration
3.6. Search Path Configuration
4. Getting Familiar with the Sonargraph System Model
4.1. Physical File Structure
4.2. Language Independent Model
4.3. Language Specific Models
4.3.1. Java Model
4.3.2. C++ Model
4.3.3. C# Model
4.4. Logical Models
4.4.1. System-Based Logical Model
4.4.2. Module-Based Logical Model
5. Creating a System
5.1. Quality Model
5.1.1. Importing a Quality Model
5.1.2. Exporting a Quality Model
6. Adding Content to a System
6.1. Creating or Importing a Java Module
6.1.1. Importing Java Modules Using an Eclipse Workspace
6.1.2. Importing Java Modules from IntelliJ
6.1.3. Importing Java Modules from Maven POM File
6.1.4. Creating a Java Module Manually
6.2. Creating or Importing a C++ Module
6.2.1. Importing C++ Modules from Visual Studio 2010 Files
6.2.2. Importing C++ Modules Using Make Command Capturing Files
6.2.3. Creating a C++ Module Manually
6.3. Creating or Importing a C# Module
6.3.1. Importing C# Modules Using a Visual Studio Project File
6.3.2. Importing C# Modules Using a Visual Studio Solution File
6.3.3. Creating a C# Module Manually
6.3.4. C# Module Configuration
7. Interacting with a System
7.1. User Interface Components
7.1.1. Menu Bar
7.1.2. Tool Bar
7.1.3. Notifications Bar
7.2. Common Interaction Patterns
7.2.1. Special Graphic Elements Decorations
7.3. Sonargraph Workbench
7.4. Navigating through the System Components
7.5. Exploring the System Namespaces
7.6. Managing the System Files
7.7. Managing the Workspace
7.7.1. Definition of Component Filters, Modules and Root Directories
7.7.2. Managing Module Dependencies
7.7.3. Creating Workspace Profiles for Build Environments
7.8. Analyzing Cycles
7.8.1. Revising Cycle Groups
7.8.2. Inspecting Cyclic Elements
7.8.3. Breaking Up Cycles
7.9. Exploring the System
7.9.1. Concepts for System Exploration
7.9.2. Tree Based System Exploration
7.9.3. Graph Based System Exploration
7.9.4. Tabular System Exploration
7.10. Searching Elements
7.10.1. Searching Elements in Views
7.11. Detecting Duplicate Code
7.11.1. Configuration of Duplicate Code Blocks Computation
7.12. Examining the Source Code
7.12.1. Interaction with Auxiliary Views
7.13. Examining Metrics Results
7.14. Analyzing C++ Include Dependencies
7.15. Creating a Report
8. Handling Detected Issues
8.1. Using Virtual Models for Resolutions
8.2. Examining Issues
8.3. Ignoring Issues
8.4. Defining Fix And TODO Tasks
8.5. Editing Resolutions
9. Simulating Refactorings
9.1. Creating Delete Refactorings
9.2. Creating Move/Rename Refactorings
9.3. Managing Refactorings
9.4. Best Practices
10. Extending the Static Analysis
10.1. Interaction with Auxiliary Views
10.2. Groovy Scripts From Quality Model
10.3. Creating a new Groovy Script
10.3.1. Default Parameters in a Script
10.3.2. Adding Parameters
10.3.3. Creating Run Configurations
10.4. Editing a Groovy Script
10.4.1. Auto Completion
10.4.2. Compiling a Groovy Script
10.5. Producing Results with Groovy Scripts
10.6. Running a Groovy Script Automatically
10.7. Managing Groovy Scripts
10.8. Groovy Script Best Practices
10.8.1. Only Visit What is Needed
10.8.2. Find Text in Code
11. Defining an Architecture
11.1. Components and Artifacts
11.2. Interfaces and Connectors
11.3. Creating Architectural Aspects
11.4. Extending Aspect Based Artifacts
11.5. Extending Interfaces or Connectors
11.6. Restricting Dependency Types
11.7. Connecting Complex Artifacts
11.8. Introducing Connection Schemes
11.9. Artifact Classes
11.10. How to Organize your Code
11.11. Designing Generic Architectures Using Templates
11.11.1. Using unrestricted generated artifacts
11.11.2. Using connection schemes to regulate accessibility
11.12. Best Practices
11.13. Architecture DSL Language Specification
12. Reporting Changes
13. Build Server Integration
14. IDE Integration
14.1. Eclipse Plugin
14.1.1. Assigning a System
14.1.2. Displaying Issues and Tasks
14.1.3. Suspending / Resuming Quality Monitoring
14.1.4. Getting Back In Sync with Manual Refresh
14.1.5. Execute Refactorings in Eclipse
14.2. IntelliJ Plugin
14.2.1. Assigning a System
14.2.2. Displaying Issues and Tasks
14.2.3. Toolbar
14.2.4. Getting Back In Sync with Manual Refresh
14.2.5. Execute Refactorings in IntelliJ
15. Metric Definitions
15.1. Language Independent Metrics
15.2. Java Metrics
15.3. C# Metrics
15.4. C/C++ Metrics
16. How to Resolve Issues
16.1. Language Independent Issues
16.2. Java Specific Issues
16.3. C# Specific Issues
16.4. C/C++ Specific Issues
17. FAQ
17.1. Out Of Memory Exceptions
17.2. Groovy Template
17.3. MSBuild Error (MSB4019) during Analysis of Visual Studio C# Project
18. References
19. Trademark Attributions, Library License Texts, and Source Code
20. Legal Notice
Glossary
1. Walk Through Tutorial (Java)
1.1. Workspace Definition
1.2. Basic Analysis
1.3. Advanced Analysis
1.4. Architecture: Artifacts, Templates and Standard Connections
1.5. Architecture: Explicit Interfaces and Connectors
1.6. Architecture: Advanced Connections
1.7. Architecture: Advanced Templating
1.8. Architecture: Referencing external Artifacts in Templates
1.9. Headless Check with Sonargraph Build
1.10. Check at Development Time with Sonargraph Eclipse Integration
2. Tutorial - Java
2.1. Setup the Software System
2.1.1. Create a new Software System
2.1.2. Define the Workspace
2.1.3. Define Module Dependencies
2.1.4. Parse the Workspace
2.2. Initial Analysis
2.2.1. Detect Problems Using Standard Metrics
2.2.2. Adjust Metric Thresholds
2.3. Problem Analysis
2.3.1. Examine Cycles
2.3.2. Examine Duplicate Code
2.3.3. Handle Issues
2.4. Detailed Dependency Analysis
2.4.1. Explore Dependencies
2.4.2. Check how Elements are Connected via Graph View
2.4.3. Check how Elements are Connected via the Dependencies View
2.4.4. Search for Elements
2.5. Advanced Analysis With Scripts
2.5.1. Create a New Script
2.5.2. Execute Existing Script
2.6. Share Results
2.6.1. Work with Snapshots
2.6.2. Define Quality Standards using Quality Models
2.6.3. Export to Excel
3. Tutorial - C#
3.1. Setup the Software System
3.1.1. Create a new Software System
3.1.2. Configure the Workspace
3.2. Further Steps
4. Tutorial - C++
4.1. Setup the Software System - Compiler Definitions
4.2. Setup the Software System - Makefile Capturing
4.3. Setup the Software System - Visual Studio Import
4.4. Further Steps
5. Sonargraph Script API Documentation
Index
List of Figures
1.1. Sonargraph Products
3.1. Editor Preferences
3.2. C++ Compiler Definition
3.3. C# Profiles Configuration
3.4. C# Build Executor
3.5. Search Path Configuration
4.1. Physical File Structure
4.2. System Domain Model
4.3. Java Domain Model
4.4. C++ Domain Model
4.5. C# Domain Model
4.6. Physical Namespaces
4.7. Logical Namespaces
4.8. System-Based Logical Model
4.9. Module-based Logical Model
5.1. Marking root directories from JSON file
5.2. Naming modules for root directories from JSON file
5.3. New System with Quality Model
5.4. Import Quality Model
5.5. Export Quality Model
6.1. Importing Java Modules Using an Eclipse workspace
6.2. Importing Java Modules from IntelliJ
6.3. Importing Java Maven Modules
6.4. Manage Root Directory Path
6.5. Create C/C++ System Based on Solution File Import
6.6. Choosing C++ Modules to Import from Capturing Files
6.7. Renaming and Configuring C++ Modules to Import from Capturing Files
6.8. C++ Manual Module Configuration
6.9. Missing C# Assemblies
6.10. C# Module Configuration
6.11. Locate Missing C# Assemblies
7.1. Tool Bar
7.2. Notifications Bar
7.3. Sonargraph Workbench
7.4. Navigation View
7.5. Namespaces View
7.6. Logical Model Selection
7.7. Files View
7.8. Workspace View
7.9. Defining a Manual Workspace Dependency
7.10. Defining a Manual Workspace Dependency
7.11. Creating Workspace Profile
7.12. Cycle Groups View
7.13. Cycle View
7.14. Cycle Break Up View
7.15. Quick View Creation
7.16. Quick View Creation
7.17. Focus Toolbar
7.18. Focus Dropdown Menu
7.19. Advanced Focus Dialog
7.20. Semantics of Colors
7.21. Architecture Independent Dependencies
7.22. Exploration View
7.23. Before and After Drilldown
7.24. Sample Exploration view
7.25. Extend Focus Menu
7.26. Extend Focus Result
7.27. Sample Exploration view
7.28. Extend Focus Menu
7.29. Underlying Parser Dependencies for Arc
7.30. Incoming and Outgoing Parser Dependencies
7.31. View option synchronization
7.32. Expand Dependency to Component Level
7.33. Mark a Selection
7.34. Context Menu Interactions
7.35. View Options
7.36. Graph View
7.37. Levels in Graph View
7.38. On Demand Cycle Groups
7.39. On Demand Cycle Groups
7.40. Underlying Parser Dependencies for Edge
7.41. Incoming and Outgoing Parser Dependencies
7.42. View option synchronization
7.43. Context Menu Interactions
7.44. Show Type-based Graph view
7.45. Type-based Graph
7.46. View Options
7.47. Dependencies View
7.48. Drilling Down Dependencies
7.49. Interaction with Auxiliary Views
7.50. Context Menu Interactions
7.51. Standard Search Dialog
7.52. Search Dialog to Locate Members
7.53. Text Search in Views
7.54. Duplicate Blocks View
7.55. Duplicates Source View
7.56. Source View
7.57. Hyperlinking and Find Text Features in Source View
7.58. Show Only Violations
7.59. Metrics View
7.60. Element Metrics View
7.61. Metric Thresholds Configuration
7.62. C++ Include Dependency View
7.63. Table Filter Options in HTML Report
8.1. Virtual Models
8.2. Issues View
8.3. Filter Issues
8.4. Ignore View
8.5. Resolution Dialog
9.1. Refactorings View
10.1. Script View
10.2. Quality Model
10.3. New Script
10.4. Parameter Definition
10.5. Parameter Usage in Script
10.6. Create Run Configuration
10.7. Auto Completion
10.8. Script View Marker
10.9. Script View Marker Tooltip
10.10. Script View Elements Tab
10.11. Script View Tree Tab
10.12. Script View Issues Preview
10.13. Script View Metrics Preview
10.14. Script Runner
11.1. Architecture of the order management micro service
11.2. Layering of a subsystem
14.1. Open Sonargraph System
14.2. Show Issues in Problems View
14.3. Problems View Configuration for Sonargraph Issues
14.4. Context Menu To Open Sonargraph Cycle Groups View
14.5. Open Sonargraph System
14.6. Sonargraph Tool Window
2.1. New Manual System Wizard
2.2. Root Directories Dialog
2.3. Workspace View
2.4. Workspace View After Parsing
2.5. Metrics View
2.6. Metrics View Highlighting Thresholds Violations
2.7. Filter Issues
2.8. Cycle Groups View
2.9. Cycle View
2.10. Duplicate Code Blocks View
2.11. Duplicate Source View
2.12. Add TODO Issue
2.13. Resolutions View
2.14. Open in Exploration View
2.15. Exploration View Drilldown
2.16. Exploration View Interactions
2.17. Graph View
2.18. Graph View Interactions
2.19. Dependencies View
2.20. Create a New Script
2.21. Execute a Script
2.22. Export Metrics to Excel Context Menu
3.1. System based on C# Visual Studio Solution File
3.2. Select C# Solution File, Configuration and Platform
3.3. Issues after initial Import of Microsoft Visual Studio Solution File
3.4. C# Module Configuration Dialog
3.5. Manage Assembly Directories - Systeme Profile (Unresolved Assemblies)
3.6. Manage Assembly Directories - Systeme Profile (Resolved Assemblies)
3.7. Workspace Dependencies View for NHibernate
4.1. Select C++ Modules to Import from Capturing Files
4.2. Renaming and Configuring C++ Modules to Import from Capturing Files
4.3. Specify Visual Studio Solution File
4.4. MSBuild Exception
4.5. Parse Error (Missing Header File)