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
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description IArchitectureVisitor
createArchitectureVisitor()
Create a new visitor for architectural models.ICoreVisitor
createVisitor()
Create a new language agnostic visitor.INamedElementAccess
findElementByFqn(java.lang.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<java.lang.Boolean> predicate, int limit)
SearchResult<? extends IFieldAccess>
findFields(groovy.lang.Closure<java.lang.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<java.lang.Boolean> predicate, int limit)
SearchResult<? extends IMethodAccess>
findMethods(groovy.lang.Closure<java.lang.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<java.lang.Boolean> predicate, int limit)
SearchResult<? extends IRoutineAccess>
findRoutines(groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
SearchResult<? extends ITypeAccess>
findTypes(groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
<T extends INamedElementAccess>
SearchResult<? extends ITypeAccess>findTypes(T searchRoot, groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
java.lang.Float
getACDMetric()
java.io.File
getBaseDirectory()
java.lang.Integer
getBiggestComponentCycleGroupMetric()
java.lang.Float
getBiggestModuleACDMetric()
java.lang.Integer
getCCDMetric()
java.lang.Integer
getCodeCommentLinesMetric()
java.lang.Integer
getCommentLinesMetric()
java.lang.Integer
getComponentCyclicityMetric()
java.lang.Integer
getComponentDependenciesToRemoveMetric()
java.lang.Integer
getComponentParserDependenciesToRemoveMetric()
java.lang.Float
getComponentRelativeCyclicityMetric()
java.util.List<IComponentAccess>
getComponents()
Gets a list of all components of the software systemjava.lang.Integer
getComponentStructuralDebtIndexMetric()
java.lang.Integer
getLinesOfCodeMetric()
java.lang.Float
getMaintainabilityLevelMetric()
java.lang.Float
getNCCDMetric()
java.lang.Integer
getNumberOfAllViolatingComponentsMetric()
This method should no longer be used.java.lang.Integer
getNumberOfArtifactsMetric()
java.lang.Integer
getNumberOfCodeDuplicatesMetric()
java.lang.Integer
getNumberOfComponentCycleGroupsMetric()
java.lang.Integer
getNumberOfComponentsInDeprecatedArtifactsMetric()
java.lang.Integer
getNumberOfComponentsMetric()
java.lang.Integer
getNumberOfComponentViolationsMetric()
java.lang.Integer
getNumberOfComponntsInDeprectaedArtifactsMetric()
Deprecated.java.lang.Integer
getNumberOfCyclicComponentsMetric()
java.lang.Integer
getNumberOfCyclicModulesMetric()
java.lang.Integer
getNumberOfDuplicatedLinesMetric()
java.lang.Integer
getNumberOfEmptyArtifactsMetric()
java.lang.Integer
getNumberOfIgnoredCodeDuplicatesMetric()
java.lang.Integer
getNumberOfIgnoredCyclicComponentsMetric()
java.lang.Integer
getNumberOfIgnoredParserDependencyViolationsMetric()
java.lang.Integer
getNumberOfModulesMetric()
java.lang.Integer
getNumberOfParserDependencyViolationsMetric()
java.lang.Integer
getNumberOfStatementsMetric()
java.lang.Integer
getNumberOfUnassignedComponentsMetric()
java.lang.Integer
getNumberOfViolatingComponentsMetric()
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.Number lowerThreshold, java.lang.Number upperThreshold, com.hello2morrow.sonargraph.core.model.script.MetricSorting sorting, double minValue, double maxValue, java.lang.String... categoryIds)
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.Number lowerThreshold, java.lang.Number upperThreshold, java.lang.Number bestValue, java.lang.Number worstValue, java.lang.String... categoryIds)
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.Number lowerThreshold, java.lang.Number upperThreshold, java.lang.String... categoryIds)
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess
getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.String... categoryIds)
java.lang.Float
getPropagationCostMetric()
java.lang.Integer
getSourceElementCountMetric()
java.lang.Integer
getTotalLinesMetric()
void
visitActiveArchitectureModel(IArchitectureVisitor visitor, java.lang.String name)
Visit a specific active architecture modelvoid
visitActiveArchitectureModels(IArchitectureVisitor visitor)
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 Detail
-
getComponents
java.util.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
INamedElementAccess findElementByFqn(java.lang.String fqn)
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
void visitModel(ICoreVisitor visitor)
Visit the complete model- Parameters:
visitor
- the visitor
-
visitParserModel
void visitParserModel(ICoreVisitor visitor)
Visit only the parser model- Parameters:
visitor
- the visitor
-
visitLogicalModuleNamespaces
void visitLogicalModuleNamespaces(ICoreVisitor visitor)
Visit module level logical namespaces- Parameters:
visitor
- the visitor
-
visitLogicalSystemNamespaces
void visitLogicalSystemNamespaces(ICoreVisitor visitor)
Visit system level logical namespaces- Parameters:
visitor
- the visitor
-
visitActiveArchitectureModels
void visitActiveArchitectureModels(IArchitectureVisitor visitor)
Visit all active architectural models- Parameters:
visitor
- the visitor
-
visitActiveArchitectureModel
void visitActiveArchitectureModel(IArchitectureVisitor visitor, java.lang.String name)
Visit a specific active architecture model- Parameters:
visitor
- the visitorname
- the name of the model without extension
-
getBaseDirectory
java.io.File getBaseDirectory()
- Returns:
- the directory of the Sonargraph system definition
-
findTypes
<T extends INamedElementAccess> SearchResult<? extends ITypeAccess> findTypes(T searchRoot, groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
-
findTypes
SearchResult<? extends ITypeAccess> findTypes(groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
-
findFields
SearchResult<? extends IFieldAccess> findFields(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
-
findFields
SearchResult<? extends IFieldAccess> findFields(groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
-
findRoutines
SearchResult<? extends IRoutineAccess> findRoutines(com.hello2morrow.sonargraph.core.api.model.ElementAccess<? extends com.hello2morrow.sonargraph.core.model.element.NamedElement> searchRoot, groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
-
findRoutines
SearchResult<? extends IRoutineAccess> findRoutines(groovy.lang.Closure<java.lang.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<java.lang.Boolean> predicate, int limit)
-
findMethods
SearchResult<? extends IMethodAccess> findMethods(groovy.lang.Closure<java.lang.Boolean> predicate, int limit)
-
getOrCreateMetricId
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.Number lowerThreshold, java.lang.Number upperThreshold, java.lang.Number bestValue, java.lang.Number worstValue, java.lang.String... categoryIds)
-
getOrCreateMetricId
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.Number lowerThreshold, java.lang.Number upperThreshold, com.hello2morrow.sonargraph.core.model.script.MetricSorting sorting, double minValue, double maxValue, java.lang.String... categoryIds)
-
getOrCreateMetricId
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.Number lowerThreshold, java.lang.Number upperThreshold, java.lang.String... categoryIds)
-
getOrCreateMetricId
com.hello2morrow.sonargraph.core.api.script.model.MetricIdAccess getOrCreateMetricId(java.lang.String id, java.lang.String presentationName, java.lang.String description, boolean isFloat, java.lang.String... categoryIds)
-
getACDMetric
java.lang.Float getACDMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getBiggestComponentCycleGroupMetric
java.lang.Integer getBiggestComponentCycleGroupMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getCCDMetric
java.lang.Integer getCCDMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getCodeCommentLinesMetric
java.lang.Integer getCodeCommentLinesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getCommentLinesMetric
java.lang.Integer getCommentLinesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getLinesOfCodeMetric
java.lang.Integer getLinesOfCodeMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNCCDMetric
java.lang.Float getNCCDMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentCycleGroupsMetric
java.lang.Integer getNumberOfComponentCycleGroupsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentsMetric
java.lang.Integer getNumberOfComponentsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfCyclicComponentsMetric
java.lang.Integer getNumberOfCyclicComponentsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfIgnoredCyclicComponentsMetric
java.lang.Integer getNumberOfIgnoredCyclicComponentsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfStatementsMetric
java.lang.Integer getNumberOfStatementsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getPropagationCostMetric
java.lang.Float getPropagationCostMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getSourceElementCountMetric
java.lang.Integer getSourceElementCountMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getTotalLinesMetric
java.lang.Integer getTotalLinesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfCodeDuplicatesMetric
java.lang.Integer getNumberOfCodeDuplicatesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfDuplicatedLinesMetric
java.lang.Integer getNumberOfDuplicatedLinesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfIgnoredCodeDuplicatesMetric
java.lang.Integer getNumberOfIgnoredCodeDuplicatesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getBiggestModuleACDMetric
java.lang.Float getBiggestModuleACDMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getComponentCyclicityMetric
java.lang.Integer getComponentCyclicityMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getComponentRelativeCyclicityMetric
java.lang.Float getComponentRelativeCyclicityMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getComponentStructuralDebtIndexMetric
java.lang.Integer getComponentStructuralDebtIndexMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getComponentParserDependenciesToRemoveMetric
java.lang.Integer getComponentParserDependenciesToRemoveMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getComponentDependenciesToRemoveMetric
java.lang.Integer getComponentDependenciesToRemoveMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfUnassignedComponentsMetric
java.lang.Integer getNumberOfUnassignedComponentsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentViolationsMetric
java.lang.Integer getNumberOfComponentViolationsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfViolatingComponentsMetric
java.lang.Integer getNumberOfViolatingComponentsMetric()
- Returns:
- number of components with non-ignored outgoing architecture violations or 'null' if not available
-
getNumberOfAllViolatingComponentsMetric
java.lang.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
java.lang.Integer getNumberOfParserDependencyViolationsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfIgnoredParserDependencyViolationsMetric
java.lang.Integer getNumberOfIgnoredParserDependencyViolationsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfModulesMetric
java.lang.Integer getNumberOfModulesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfCyclicModulesMetric
java.lang.Integer getNumberOfCyclicModulesMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfArtifactsMetric
java.lang.Integer getNumberOfArtifactsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfEmptyArtifactsMetric
java.lang.Integer getNumberOfEmptyArtifactsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponntsInDeprectaedArtifactsMetric
@Deprecated java.lang.Integer getNumberOfComponntsInDeprectaedArtifactsMetric()
Deprecated.- Returns:
- the corresponding metric or 'null' if not available
-
getNumberOfComponentsInDeprecatedArtifactsMetric
java.lang.Integer getNumberOfComponentsInDeprecatedArtifactsMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
getMaintainabilityLevelMetric
java.lang.Float getMaintainabilityLevelMetric()
- Returns:
- the corresponding metric or 'null' if not available
-
-