0.5.1 • Published 7 months ago

@dxworks/jafax v0.5.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
7 months ago

Java Fact eXtractor

Java Fact Extractor (JaFaX) is a code analysis tool used to find irregularities with Java based software projects.

Start Up

  • Import project with Maven
  • Run mvn clean install
  • Run with the path you want to analyze as an argument or run inside the project you wish to analyze
  • If a JSON file is found inside the directory, it will be used instead of creating an AST tree, otherwise it will create one
  • It will then continue to parse the JSON and calculate the relations and metrics. The JSON creation is done in order to allow the user to modify the JSON in case there are multiple projects with classes with the same signature.

Results

Layout

Class

nametypedescription
typeStringProperty needed by the kotlinx serializer, always Class
idLongThe unique id of the object (shared among all types)
nameStringThe name of the class
fileNameStringThe name of the containing file
isInterfaceBooleanA value representing if the class is an interface or not, only appears if its value is true
modifiersList<String>The modifiers of the class
containerLongThe id of its container (class or method)
superClassLongThe id of its superClass
interfacesList<Long>The list of ids of its interfaces
isExternalBooleanA value representing if the class is from the source project or not, only appears if its value is true
isTypeParameterBooleanA value representing if the class ia type parameter or not, only appears if its value is true
instancesList<Long>The list of ids of its parameter instances. Meaning that when you have A<T> and have an instance somewhere declared of A<String>, T will have String in its parameterInstances
typeParametersList<Long>The list of ids of its type parameters
containedFieldsList<Long>The list of ids of its directly contained fields
containedClassesList<Long>The list of ids of its directly contained classes
containedMethodsList<Long>The list of ids of its directly contained methods
accessedFieldsList<Long>The list of ids of its accessed fields inside the initializer of the class
calledMethodsList<Long>The list of ids of its called methods inside the initializer of the class

Method

nametypedescription
typeStringProperty needed by the kotlinx serializer, always Method
idLongThe unique id of the object (shared among all types)
nameStringThe name of the method
signatureStringThe signature of the method
isConstructorBooleanA value representing if the method is a constructor or not, only appears if its value is true
isDefaultConstructorBooleanA value representing if the method is a default constructor or not, only appears if its value is true
returnTypeLongThe return type of the method
modifiersList<String>The modifiers of the method
containerLongThe id of its container (class or method)
parametersList<Long>The list of ids of its parameters
localVariablesList<Long>The list of ids of its directly contained local variables
typeParametersList<Long>The list of ids of its type parameters
cyclomaticComplexityLongA value representing the method's cyclomatic complexity
containedClassesList<Long>The list of ids of its directly contained classes
containedMethodsList<Long>The list of ids of its directly contained methods
accessedFieldsList<Long>The list of ids of its directly accessed fields
calledMethodsList<Long>The list of ids of its directly called methods

Attribute

nametypedescription
typeStringProperty needed by the kotlinx serializer, always Attribute
idLongThe unique id of the object (shared among all types)
nameStringThe name of the attribute
returnTypeLongThe type of the attribute
modifiersList<String>The modifiers of the attribute
kindStringThe attribute kind, can be either Parameter, Field or LocalVariable

Relations

namecalculation levelcalculation formula

Metrics

namecalculation formula
ATFDThe sum of all public accessed attributes (outside of constructors) from inside a class.
ATFD2The sum of all public accessed attributes which have a user-defined type (outside of constructors) from inside a class.
CCThe sum of all classes that call methods from the measured class.
CMThe sum of all methods that call methods from the measured class.

Anti-Patterns

namecalculation levelcalculation formula