| soot.toolkits.astmetrics.ASTMetric soot.toolkits.astmetrics.IdentifiersMetric
IdentifiersMetric | public class IdentifiersMetric extends ASTMetric (Code) | | author: Michael Batchelder author: Created on 5-Mar-2006 |
Constructor Summary | |
public | IdentifiersMetric(Node astNode) Parameters: astNode - This metric will take a measure of the "complexity" of each identifier usedwithin the program. |
dictionarySize | int dictionarySize(Code) | | |
nameComplexity | double nameComplexity(Code) | | |
nameCount | double nameCount(Code) | | |
IdentifiersMetric | public IdentifiersMetric(Node astNode)(Code) | | Parameters: astNode - This metric will take a measure of the "complexity" of each identifier usedwithin the program. An identifier's complexity is computed as follows:First the alpha tokens are parsed by splitting on non-alphas and capitals:example identifier: getASTNode alpha tokens: get, AST, Nodeexample identifier: ___Junk$$name alpha tokens: Junk, name)The alpha tokens are then counted and a 'token complexity' is formed by the ratioof total tokens to the number of tokens found in the dictionary:example identifier: getASTNode Total: 3, Found: 2, Complexity: 1.5Then the 'character complexity' is computed, which is a ratio of total number ofcharacters to the number of non-complex characters. Non-complex characters are those which are NOT part of a multiple string of non-alphas.example identifier: ___Junk$$name complex char strings: '___', '$$'number of non-complex (Junk + name): 8, total: 13, Complexity: 1.625Finally, the total identifier complexity is the sum of the token and charactercomplexities multipled by the 'importance' of an identifier:Multipliers are as follows:Class multiplier = 3;Method multiplier = 4;Field multiplier = 2;Formal multiplier = 1.5;Local multiplier = 1; |
enter | public NodeVisitor enter(Node parent, Node n)(Code) | | |
reset | public void reset()(Code) | | |
|
|