Interface IScriptCoreAccess
- All Known Subinterfaces:
IScriptCppAccess
,IScriptCSharpAccess
,IScriptJavaAccess
,IScriptPythonAccess
public interface IScriptCoreAccess
Main access point for language agnostic scripts. There is always a variable named "coreAccess" available for all scripts.
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new visitor for architectural models.Create a new language agnostic visitor.findElementByFqn
(String fqn) Find an element by its fully qualified nameSearchResult
<? extends IFieldAccess> findFields
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) SearchResult
<? extends IFieldAccess> findFields
(groovy.lang.Closure<Boolean> predicate, int limit) SearchResult
<? extends IMethodAccess> findMethods
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) SearchResult
<? extends IMethodAccess> findMethods
(groovy.lang.Closure<Boolean> predicate, int limit) SearchResult
<? extends IRoutineAccess> findRoutines
(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) SearchResult
<? extends IRoutineAccess> findRoutines
(groovy.lang.Closure<Boolean> predicate, int limit) SearchResult
<? extends ITypeAccess> <T extends INamedElementAccess>
SearchResult<? extends ITypeAccess> Gets a list of all components of the software systemThis method should no longer be used.Deprecated.com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId
(String id, String presentationName, String description, boolean isFloat, Number lowerThreshold, Number upperThreshold, com.hello2morrow.sonargraph.core.model.script.MetricSorting sorting, double minValue, double maxValue, String... categoryIds) com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId
(String id, String presentationName, String description, boolean isFloat, Number lowerThreshold, Number upperThreshold, Number bestValue, Number worstValue, String... categoryIds) com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId
(String id, String presentationName, String description, boolean isFloat, Number lowerThreshold, Number upperThreshold, String... categoryIds) com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId
(String id, String presentationName, String description, boolean isFloat, String... categoryIds) void
visitActiveArchitectureModel
(IArchitectureVisitor visitor, String name) Visit a specific active architecture modelvoid
Visit all active architectural modelsvoid
visitLogicalModuleNamespaces
(ICoreVisitor visitor) Visit module level logical namespacesvoid
visitLogicalSystemNamespaces
(ICoreVisitor visitor) Visit system level logical namespacesvoid
visitModel
(ICoreVisitor visitor) Visit the complete modelvoid
visitParserModel
(ICoreVisitor visitor) Visit only the parser model
-
Method Details
-
getComponents
List<IComponentAccess> getComponents()Gets a list of all components of the software system- Returns:
- Component list
-
createVisitor
ICoreVisitor createVisitor()Create a new language agnostic visitor.- Returns:
- a new visitor
-
createArchitectureVisitor
IArchitectureVisitor createArchitectureVisitor()Create a new visitor for architectural models.- Returns:
- a new visitor
-
findElementByFqn
Find an element by its fully qualified name- Parameters:
fqn
- The fully qualified name of the element (to be found in Sonargraph properties view). Must not be null, empty or contain only whitespace.- Returns:
- The element or null, if no element with that fully qualified name can be found.
-
visitModel
Visit the complete model- Parameters:
visitor
- the visitor
-
visitParserModel
Visit only the parser model- Parameters:
visitor
- the visitor
-
visitLogicalModuleNamespaces
Visit module level logical namespaces- Parameters:
visitor
- the visitor
-
visitLogicalSystemNamespaces
Visit system level logical namespaces- Parameters:
visitor
- the visitor
-
visitActiveArchitectureModels
Visit all active architectural models- Parameters:
visitor
- the visitor
-
visitActiveArchitectureModel
Visit a specific active architecture model- Parameters:
visitor
- the visitorname
- the name of the model without extension
-
getBaseDirectory
File getBaseDirectory()- Returns:
- the directory of the Sonargraph system definition
-
findTypes
<T extends INamedElementAccess> SearchResult<? extends ITypeAccess> findTypes(T searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) -
findTypes
-
findFields
SearchResult<? extends IFieldAccess> findFields(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) -
findFields
-
findRoutines
SearchResult<? extends IRoutineAccess> findRoutines(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) -
findRoutines
SearchResult<? extends IRoutineAccess> findRoutines(groovy.lang.Closure<Boolean> predicate, int limit) -
findMethods
SearchResult<? extends IMethodAccess> findMethods(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<Boolean> predicate, int limit) -
findMethods
SearchResult<? extends IMethodAccess> findMethods(groovy.lang.Closure<Boolean> predicate, int limit) -
getOrCreateMetricId
-
getOrCreateMetricId
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess getOrCreateMetricId(String id, String presentationName, String description, boolean isFloat, Number lowerThreshold, Number upperThreshold, com.hello2morrow.sonargraph.core.model.script.MetricSorting sorting, double minValue, double maxValue, String... categoryIds) -
getOrCreateMetricId
-
getOrCreateMetricId
-
getACDMetric
Float getACDMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getBiggestComponentCycleGroupMetric
Integer getBiggestComponentCycleGroupMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getCCDMetric
Integer getCCDMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getCodeCommentLinesMetric
Integer getCodeCommentLinesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getCommentLinesMetric
Integer getCommentLinesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getLinesOfCodeMetric
Integer getLinesOfCodeMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNCCDMetric
Float getNCCDMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentCycleGroupsMetric
Integer getNumberOfComponentCycleGroupsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentsMetric
Integer getNumberOfComponentsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfCyclicComponentsMetric
Integer getNumberOfCyclicComponentsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfIgnoredCyclicComponentsMetric
Integer getNumberOfIgnoredCyclicComponentsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfStatementsMetric
Integer getNumberOfStatementsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getPropagationCostMetric
Float getPropagationCostMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getSourceElementCountMetric
Integer getSourceElementCountMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getTotalLinesMetric
Integer getTotalLinesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfCodeDuplicatesMetric
Integer getNumberOfCodeDuplicatesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfDuplicatedLinesMetric
Integer getNumberOfDuplicatedLinesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfIgnoredCodeDuplicatesMetric
Integer getNumberOfIgnoredCodeDuplicatesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getBiggestModuleACDMetric
Float getBiggestModuleACDMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getComponentCyclicityMetric
Integer getComponentCyclicityMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getComponentRelativeCyclicityMetric
Float getComponentRelativeCyclicityMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getComponentStructuralDebtIndexMetric
Integer getComponentStructuralDebtIndexMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getComponentParserDependenciesToRemoveMetric
Integer getComponentParserDependenciesToRemoveMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getComponentDependenciesToRemoveMetric
Integer getComponentDependenciesToRemoveMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfUnassignedComponentsMetric
Integer getNumberOfUnassignedComponentsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentViolationsMetric
Integer getNumberOfComponentViolationsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfViolatingComponentsMetric
Integer getNumberOfViolatingComponentsMetric()- Returns:
- number of components with non-ignored outgoing architecture violations or 'null' if not available
-
getNumberOfAllViolatingComponentsMetric
Integer getNumberOfAllViolatingComponentsMetric()This method should no longer be used. Use the 'Parser' virtual model to obtain the unaltered metric. If you use this method the metric value might change depending on the selected virtual model.- Returns:
getNumberOfViolatingComponentsMetric()
.
-
getNumberOfParserDependencyViolationsMetric
Integer getNumberOfParserDependencyViolationsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfIgnoredParserDependencyViolationsMetric
Integer getNumberOfIgnoredParserDependencyViolationsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfModulesMetric
Integer getNumberOfModulesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfCyclicModulesMetric
Integer getNumberOfCyclicModulesMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfArtifactsMetric
Integer getNumberOfArtifactsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfEmptyArtifactsMetric
Integer getNumberOfEmptyArtifactsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponntsInDeprectaedArtifactsMetric
Deprecated.- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentsInDeprecatedArtifactsMetric
Integer getNumberOfComponentsInDeprecatedArtifactsMetric()- Returns:
- the corresponding metric or 'null' if not available
-
getMaintainabilityLevelMetric
Float getMaintainabilityLevelMetric()- Returns:
- the corresponding metric or 'null' if not available
-