Class ClassMetrics
The metrics for a class
Import path
import python
Direct supertypes
Predicates
getAfferentCoupling | Gets the afferent coupling of a class – the number of classes that directly depend on it. |
getEfferentCoupling | Gets the efferent coupling of a class – the number of classes that it directly depends on. |
getInheritanceDepth | |
getLackOfCohesionCK | return Chidamber and Kemerer Lack of Cohesion |
getLackOfCohesionHM | return Hitz and Montazeri Lack of Cohesion |
getNumberOfLines | Gets the total number of lines (including blank lines) from the definition to the end of the class |
getNumberOfLinesOfCode | Gets the number of lines of code in the class |
getNumberOfLinesOfComments | Gets the number of lines of comments in the class |
getNumberOfLinesOfDocStrings | Gets the number of lines of docstrings in the class |
ignoreLackOfCohesion | should function f be excluded from the cohesion computation? |
unionSubgraph |
Inherited predicates
contains | Whether this contains | from Class |
containsInScope | from Class | |
getABase | Gets a base of this class definition. | from Class |
getAChildNode | Gets a child node of this node in the AST. This predicate exists to aid exploration of the AST and other experiments. The child-parent relation may not be meaningful. For a more meaningful relation in terms of dependency use Expr.getASubExpression(), Stmt.getASubStatement(), Stmt.getASubExpression() or Scope.getAStmt(). | from Class |
getADecorator | Gets a decorator of this class. | from Class |
getAFlowNode | Gets a flow node corresponding directly to this node. NOTE: For some statements and other purely syntactic elements, there may not be a | from AstNode |
getAMethod | Gets a method defined in this class | from Class |
getANormalExit | Gets an exit from this Scope’s control flow graph, that does not result from an exception | from Scope |
getAStmt | Gets a statement in the class | from Class |
getAnExitNode | Gets an exit from this Scope’s control flow graph | from Scope |
getBase | Gets the nth base of this class definition. | from Class |
getBody | Gets the statements forming the body of this class | from Class |
getClassObject | Gets the ClassObject corresponding to this class | from Class |
getDocString | Gets the docstring for this scope | from Scope |
getEnclosingModule | from Scope | |
getEnclosingScope | Gets the scope (module, class or function) in which this class is defined | from Class |
getEntryNode | Gets the entry point into this Scope’s control flow graph | from Scope |
getEvaluatingScope | Gets the evaluation scope for code in this (lexical) scope. This is usually the scope itself, but may be an enclosing scope. Notably, for list comprehensions in Python 2. | from Scope |
getFallthroughNode | Gets the non-explicit exit from this Scope’s control flow graph | from Scope |
getInitMethod | Gets a defined init method of this class | from Class |
getLastStatement | from Scope | |
getLocation | Gets the location for this AST node | from Class |
getMetaClass | Gets the metaclass expression | from Class |
getMetrics | Gets the metrics for this class | from Class |
getName | Gets the name used to define this class | from Class |
getParent | Gets a parent of this class | from Class_ |
getParentNode | Gets the parent node of this node in the AST. This predicate exists to aid exploration of the AST and other experiments. The child-parent relation may not be meaningful. For a more meaningful relation in terms of dependency use Expr.getASubExpression(), Stmt.getASubStatement(), Stmt.getASubExpression() or Scope.getAStmt() applied to the parent. | from AstNode |
getQualifiedName | Gets the qualified name for this class. Should return the same name as the | from Class |
getReturnNode | Gets the exit of this scope following from a return statement | from Scope |
getScope | Use getEnclosingScope() instead | from Class |
getStmt | Gets the nth statement in the class | from Class |
hasSideEffects | Holds if this expression may have a side effect (as determined purely from its syntax). | from Class |
inSource | Holds if this scope is in the source archive, that is it is part of the code specified, not library code | from Scope |
isArtificial | Whether this syntactic element is artificial, that is it is generated by the compiler and is not present in the source | from AstNode |
isProbableMixin | Holds if this is probably a mixin (has ‘mixin’ or similar in name or docstring) | from Class |
isPublic | Holds if this scope is deemed to be public | from Scope |
isTopLevel | Holds if this a top-level (non-nested) class or function | from Scope |
precedes | Holds if this scope can be expected to execute before | from Scope |
toString | from Class |