Skip to content

Paprika model and metrics

Geoffrey Hecht edited this page Aug 20, 2014 · 20 revisions

This page describes the properties and metrics collected by Paprika and stored in the graph model.

Model entities

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.

App (Java : PaprikaApp)

Represents an analyzed application. Most of the properties are metadatas which are passed are parameters to launch the analysis.

name (Java : name)

Application name on the store.

app_key (Java : key)

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.

rating (Java : rating)

Application rating on the market, represented by a double between 0 and 5.

date_download (Java : date)

Format : yyyy-mm-dd hh:mm:ss.S Download date of the package in prevision of the analysis.

date_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/

package (Java : pack)

Name of the main application package, used as an identifier in the play store.

size (Java : size)

APK size in byte.

developer (Java : developer)

Name of the application developer.

category (Java : category)

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 (Java : price)

Price of the application the store, default value is "Free".

nb_download (Java : nbDownload)

Number of downloads of the application of the store. Formatted like 10000+,10+...

Class (Java : PaprikaClass)

Represents a class of the analyzed application. Java and Android library classes are excluded (but considered during the analysis).

name (Java : name)

Class name including package, e.g. com.example.MyClass . The name could be different from source code due to obfuscation.

app_key (Java : key)

Similar to app_key properties of PaprikaApp.

modifier (Java : modifier)

Java Access Level. See PaprikaModifiers

parent_name

Name of the parent class, default is java.lang.Object.

Variable (Java : PaprikaVariable)

Represents a class variable. The name could be different from source code due to obfuscation.

name (Java : name)

Application name on the store.

app_key (Java : key)

Similar to app_key properties of PaprikaApp.

modifier (Java : modifier)

Java Access Level. See PaprikaModifiers

type

Java type of the variable with package, default is java.lang.Object.

Method (Java : PaprikaMethod)

Represents a method of a class. The name could be different from source code due to obfuscation.

name (Java : name)

Method name. Constructors are identified by

app_key (Java : key)

Similar to app_key properties of PaprikaApp.

modifier (Java : modifier)

Java Access Level. See PaprikaModifiers

full_name

Name of a method and it's owning class, formatted as name#class_name.

return_type

Return type of the function, can be void, a java type or an object.

Argument (Java : PaprikaArgument)

Represents an argument of a method/

name (Java : name)

/!\ The name is not available in the bytecode, thus here it is the type of the argument.

app_key (Java : key)

Similar to app_key properties of PaprikaApp.

position

Position of the argument in the method signature, starting at 1.

PaprikaModifier ( Only present in Java, does not appears as a node)

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).

Relationships between entities

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.

APP_OWNS_CLASS

Relationship from App to Class. Used to determined to which application a class belongs.

CLASS_OWNS_METHOD

Relationship from Class to Method. Used to determined to which class a method belongs.

CLASS_OWNS_VARIABLE

Relationship from Class to Variable. Used to determined to which class a variable belongs.

METHOD_OWNS_ARGUMENT

Relationship from Argument to Method. Used to determined to which method an argument belongs.

EXTENDS

Relationship from Class to Class. Java and Android library class are not considered. Determine inheritance between two classes.

IMPLEMENTS

Relationship from Class to Class. Used when a class implements an interface.

CALLS

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.

USES

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.

Metrics

All the metrics are attached to a node as properties.

App (Java : PaprikaApp)

number_of_classes (Java : NumberOfClasses)

Type : Integer

number_of_activities (Java : NumberOfActivities)

Type : Integer

number_of_interfaces (Java : NumberOfInterfaces)

Type : Integer

number_of_abstract_classes (Java : NumberOfAbstractClasses)

Type : Integer

number_of_broadcast_receivers (Java : NumberOfBroadcastReceivers)

Type : Integer

number_of_content_providers (Java : NumberOfContentProviders)

Type : Integer

number_of_services (Java : NumberOfServices)

Type : Integer

Class (Java : PaprikaClass)

number_of_methods (Java : NumberOfMethods)

Type : Integer

depth_of_inheritance (Java : DepthOfInheritance)

Type : Integer

number_of_implemented_interfaces (Java : NumberOfImplementedInterfaces)

Type : Integer

number_of_attributes (Java : NumberOfAttributes)

Type : Integer

number_of_children (Java : NumberOfChildren)

Type : Integer

class_complexity (Java : ClassComplexity)

Type : Integer

coupling_between_object_classes (Java : CouplingBetweenObjects)

Type : Integer

lack_of_cohesion_in_methods (Java : LackofCohesionInMethods)

Type : Integer

is_abstract (Java : IsAbstract)

Type : Boolean

is_activity (Java : IsActivity)

Type : Boolean

is_application (Java : IsApplication)

Type : Boolean

is_broadcast_receiver (Java : IsBroadcastReceiver)

Type : Boolean

is_content_provider (Java : IsContentProvider)

Type : Boolean

is_service (Java : IsService)

Type : Boolean

is_final (Java : IsFinal)

Type : Boolean

is_static (Java : IsStatic)

Type : Boolean

is_inner_class (Java : IsInnerClass)

Type : Boolean

is_interface (Java : IsInterface)

Type : Boolean

Variable (Java : PaprikaVariable)

is_static (Java : IsStatic)

Type : Boolean

is_final (Java : IsFinal)

Type : Boolean

Method (Java : PaprikaMethod)

number_of_parameters (Java : NumberOfParameters)

Type : Integer

number_of_declared_locals (Java : NumberOfDeclaredLocals)

Type : Integer

number_of_instructions (Java : NumberOfInstructions)

Type : Integer

number_of_direct_calls (Java : NumberOfDirectCalls)

Type : Integer

number_of_callers (Java : NumberOfCallers)

Type : Integer

cyclomatic_complexity (Java : CyclomaticComplexity)

Type : Integer

is_abstract (Java : IsAbstract)

Type : Boolean

is_final (Java : IsFinal)

Type : Boolean

is_static (Java : IsStatic)

Type : Boolean

is_getter (Java : IsGetter)

Type : Boolean

is_setter (Java : IsSetter)

Type : Boolean

is_synchronized (Java : IsSynchronized)

Type : Boolean

Argument (Java : PaprikaArgument)

Clone this wiki locally