-
Notifications
You must be signed in to change notification settings - Fork 16
Paprika model and metrics
This page describes the properties and metrics collected by Paprika and stored in the graph model.
The model is composed of 6 main entities with attached properties. In the graph database each entity (excepting modifier) is represented by a node and the properties are attached to this node. In the java source code they are available in the package paprika.entities.
Represents an analyzed application. Most of the properties are metadatas which are passed are parameters to launch the analysis.
Application name on the store.
Unique identifier of an application, allowing multiple version of an application to be stored without conflict. This value is the sha256 sum of the apk. It is calculated by Paprika but it should be passed as a parameter when launching the analyze to ensure that the good package is analyzed. The app_key is added to every type of node of an application to facilitate queries.
Application rating on the market, represented by a double between 0 and 5.
Format : yyyy-mm-dd hh:mm:ss.S Download date of the package in prevision of the analysis.
Format : yyyy-mm-dd hh:mm:ss.S Date of the analysis. Not present in the analysis but added as a graph Properties at the end of the analysis/
Name of the main application package, used as an identifier in the play store.
APK size in byte.
Name of the application developer.
Category of the application on the play store. Possible values are : APP_WALLPAPER, BOOKS_AND_REFERENCE, BUSINESS, COMICS, COMMUNICATION, EDUCATION, ENTERTAINMENT, FINANCE, GAME, HEALTH_AND_FITNESS, LIBRARIES_AND_DEMO, LIFESTYLE, MEDIA_AND_VIDEO, MEDICAL, MUSIC_AND_AUDIO, NEWS_AND_MAGAZINES, PERSONALIZATION, PHOTOGRAPHY, PRODUCTIVITY, SHOPPING, SOCIAL, SPORTS, TOOLS, TRANSPORTATION, TRAVEL_AND_LOCAL, WEATHER.
Price of the application the store, default value is "Free".
Number of downloads of the application of the store. Formatted like 10000+,10+...
Represents a class of the analyzed application. Java and Android library classes are excluded (but considered during the analysis).
Class name including package, e.g. com.example.MyClass . The name could be different from source code due to obfuscation.
Similar to app_key properties of PaprikaApp.
Java Access Level. See PaprikaModifiers
Name of the parent class, default is java.lang.Object.
Represents a class variable. The name could be different from source code due to obfuscation.
Application name on the store.
Similar to app_key properties of PaprikaApp.
Java Access Level. See PaprikaModifiers
Java type of the variable with package, default is java.lang.Object.
Represents a method of a class. The name could be different from source code due to obfuscation.
Method name. Constructors are identified by
Similar to app_key properties of PaprikaApp.
Java Access Level. See PaprikaModifiers
Name of a method and it's owning class, formatted as name#class_name.
Return type of the function, can be void, a java type or an object.
Represents an argument of a method/
/!\ The name is not available in the bytecode, thus here it is the type of the argument.
Similar to app_key properties of PaprikaApp.
Position of the argument in the method signature, starting at 1.
Enum for Java Access Level, can be public, protected or private. Attached as a property to the relevant nodes in the graph (Class, Method and variable).
Nodes are connected to each other via oriented relationship to from a graph. Each application are representend by independant subgraph. The following list describes the different of relationship. In the java source code they are available in the package paprika.neo4J.
Relationship from App to Class. Used to determined to which application a class belongs.
Relationship from Class to Method. Used to determined to which class a method belongs.
Relationship from Class to Variable. Used to determined to which class a variable belongs.
Relationship from Argument to Method. Used to determined to which method an argument belongs.
Relationship from Class to Class. Java and Android library class are not considered. Determine inheritance between two classes.
Relationship from Class to Class. Used when a class implements an interface.
Relationship from Method to Method. Used when a method call another method in at least one of its execution path. Multiple calls to the same method will result to only one relationship.
Relationship from Method to Variable. Used when a method read or write into a class variable in at least one of its execution path. Multiple usage will be represented by an unique relationship.
All the metrics are attached to a node as properties. They are extracted or computed from the apk, most of them are integers but some are boolean used to distinguish specific classes. In the java source code they are available in the package paprika.metrics.
Type : Integer Total number of classes in the application.
Type : Integer Total number of interfaces in the application.
Type : Integer Total number of abstract classes in the application.
Type : Integer - Specific to Android Total number of classes extending android.app.Activity.
Type : Integer - Specific to Android Total number of classes extending android.content.BroadcastReceiver.
Type : Integer - Specific to Android Total number of classes extending android.content.ContentProvider
Type : Integer - Specific to Android Total number of classes extending android.app.Service.
Type : Integer Number of methods of the class.
Type : Integer Depth of Inheritance, starting at 1 since classes are at least java.lang.Object.
Type : Integer Number of interfaces implemented by the class.
Type : Integer Number of public, privated or protected attributes of the class.
Type : Integer Number of class extending the current class.
Class complexity is the sum of all methods complexity of the class. Type : Integer
Type : Integer Also know as CBO. Defined by Chidamber & Kemerer. CBO represents the number of other classes a class is coupled to. This metrics is calculated from the callgraph and it counts the reference to methods, variables or types once for each class.
Type : Integer Also know as LCOM2. Defined by Chidamber & Kemerer. Determined how the methods of a class are related to each others.
Type : Boolean True if the class is abstract.
Type : Boolean - Specific to Android True if the class inherits from android.app.Activity.
Type : Boolean - Specific to Android True if the class inherits from android.app.Application.
Type : Boolean - Specific to Android True if the class inherits from android.content.BroadcastReceiver.
Type : Boolean - Specific to Android True if the class inherits from android.content.ContentProvider.
Type : Boolean - Specific to Android True if the class inherits from android.app.Service.
Type : Boolean True is the class is final.
Type : Boolean True is the class is static.
Type : Boolean True is the class is an inner class. The class name will also contains a $.
Type : Boolean True is the class is an interface.
True if the variable is static. Type : Boolean
True if the variable is final. Type : Boolean
Type : Integer Numbers of parameters required by the method.
Type : Integer Numbers of locals used by the method. Can be higher that the source code number since it's extracted from the bytecode.
Numbers of instructions used by the method. Can be higher that the source code number of line since it's extracted from the bytecode. Type : Integer
Numbers of calls to another methods, library methods included. Type : Integer
Numbers of calls made to this methods by other methods. Type : Integer
McCabe cyclomatic complexity. Represents the number of execution path inside a method. Minimum is one, the number is incremented for each branche detected in the body of a method. Type : Integer
True if the method is abstract. Type : Boolean
True if the method is final. Type : Boolean
True if the method is static. Type : Boolean
True if the method is a getter. The detection is not based on the method name since obfuscation and developer pratice could make false positive or true negative. Instead a getter is detected by looking at the number of instructions, the return type , the number of exceptions and the accessed variable. Only simple getter (no condition or computation) are considered. Type : Boolean
Type : Boolean True if the method is a setter. The detection is not based on the method name since obfuscation and developer pratice could make false positive or true negative. Instead a setter is detected by looking at the number of instructions, the return type, the number of exceptions and the accessed variable. Only simple setter (no condition or computation) are considered.
Type : Boolean True if the method is synchronized.
Yet, there is no metrics attached to arguments.