Scripting Objects (Code Analysis API)

Overview

Using the Scripting Object Extensions, the returned scripting objects can be used, for example, to trigger a code analysis or to access the conventions or metrics results.

Code Analysis API

This object provides general access to code analysis of an Application object.

Property

Returned Object / Value

Description

metrics

MetricsTable with attached functions / properties

The metrics property provides access to the metrics-specific scripting API.

conventions

ConventionsTable with attached functions / properties

The conventions property provides access to the conventions-specific scripting API.

configuration

Configuration with attached functions / properties

The configuration property provides access to the conventions-specific scripting API.

cloud_connection

CloudConnection with attached functions / properties

The cloud_connection property provides access to the upload of snapshots to Triple Storages, and to configuration of the cloud connection.

Functions

Returned Object / Value

Description

clear()

None

Removes the dependency model from memory. Another code analysis run can be started.

perform_full_analysis()

None

Starts a full code analysis run. The dependency model is built and reused for example by metrics API.

store_dependency_model(filename)

None

Stores the dependency model into an XML file.

store_ttl(filename)

None

Stores the RDF model in TTL format to disk.

TTL (Turtle Language) is a standard format of https://www.w3.org to store RDF models.

Metrics API

Functions

Returned Object / Value

Description

get_all_metrics()

string[] with available metrics names

Gets the available metrics query names.

full_metrics_table()

MetricsTableResult with attached functions / properties

Builds the full metrics table of the available metrics queries.Refer to Metrics Table Result API.

metrics_table()

MetricsTableResult with attached functions / properties.

Builds the metrics table with specified metrics queries. Refer to Metrics Table Result API.

Metrics Table Result API

Properties

Returned Object / Value

Description

successful

BOOL

Gets the result outcome.

message

STRING

Gets the readable outcome message.

project_path

STRING

Gets the project path where this results are based on.

analysis_started_at

STRING

Gets the start time this result table was built.

analysis_finished_at

STRING

Gets the finished time this results table was built.

analyser_version

STRING

Gets the code analyzer version used to build this result table.

columns

STRING

Gets the list of columns in this result table.

rows

STRING

Gets the table (rows with columns: [Array] of [Array]) with the result values.

Functions

Returned Object / Value

Description

store_as_xml(…)

None

Stores the metrics table results as an XML file to disk.

store_as_csv(…)

None

Stores the metrics table results as a CSV file to disk.

store_as_html(…)

None

Stores the metrics table results as an HTML to disk.

Provides to specify an XSLT file for XML to HTML transformation, if required.

Conventions API

Functions

Returned Object / Value

Description

get_all_conventions()

STRING[] with available convention names

Gets the available convention query names.

full_conventions_table()

ConventionTableResult with attached functions / properties

Builds the full conventions table of the available convention queries.

Refer to Conventions Table Result API.

conventions_table()

ConventionTableResult with attached functions / properties.

Builds the conventions table with specified convention queries.

Refer to Conventions Table Result API.

Conventions Table Result API

Properties

Returned Object / Value

Description

successful

BOOL

Gets the result outcome.

message

STRING

Gets the readable outcome message.

project_path

STRING

Gets the project path where this results are based on.

analysis_started_at

STRING

Gets the start time this result table was built.

analysis_finished_at

STRING

Gets the finished time this results table was built.

analyser_version

STRING

Gets the code analyzer version used to build this result table.

columns

STRING

Gets the list of columns in this result table.

rows

STRING

Gets the table (rows with columns: [Array] of [Array]) with the result values.

Functions

Returned Object / Value

Description

store_as_xml(…)

None

Stores the conventions table results as an XML file to disk.

store_as_csv(…)

None

Stores the conventions table results as a CSV file to disk.

store_as_html(…)

None

Stores the conventions table results as an HTML to disk.

Provides to specify an XSLT file for XML to HTML transformation, if required.

Configuration API

Property

Returned Object / Value

Description

triple_storage_backend_type

Enumeration TripleStorageBackendTypes

Configures the RDF Triple Storage backend type to be used to handle code analysis data.

thresshold_for_out_proc_backend_usage

INT

Configures the threshold for auto-selection of used storage backend type (In-Memory or Out-Proc).

max_upload_triple_count_per_request

INT

Configures the number of triples per upload request.

query_execution_timeout

Long

Configures the query execution timeout.

update_execution_timeout

Long

Configures the update execution timeout for a query.

server_uri

STRING

Configures the server URI for http-based storage backends.

relative_query_endpoint

STRING

Configures the query endpoint for http-based storage backends (part of complete query endpoint url).

relative_update_endpoint

STRING

Configures the update endpoint for http-based storage backends (part of complete update endpoint url).

dataset

STRING

Configures the dataset name for http-based storage backends (part of the endpoint url).

relative_data_endpoint

STRING

Configures the data endpoint name for http based storage backends (part of the endpoint url).

relative_sparql_endpoint

STRING

Configures the SPARQL endpoint name for http based storage backends (part of the endpoint url).

graph_name

STRING

Configures the graph name for http based storage backends (part of the endpoint url).

sparql_endpoint

STRING

Read-only. Gets access to the complete SPARQL endpoint url.

data_endpoint

STRING

Read-only. Gets access to the complete data endpoint url.

query_endpoint

STRING

Read-only. Gets access to the complete query endpoint url.

update_endpoint

STRING

Read-only. Gets access to the complete update endpoint url.

Functions

Returned Object / Value

Description

reset()

None

Resets the code analysis configuration.

Cloud Connection API

Property

Returned Object / Value

Description

configuration

CloudConfiguration with attached functions / properties.

The cloud configuration property provides access to cloud configuration-specific scripting API.

Functions

Returned Object / Value

Description

upload_to_triple_storage(…)

None

Starts a snapshot upload of the RDF model to the configured RDF Triple Storage.

Cloud Configuration API

Property

Returned Object / Value

Description

http_backend_type

Enumeration HttpBackendTypes

Configures the http backend type (for example, generic, Apache Fuseki, Stardog, and so on). This configuration value is only considered if Triple Storage backend type is set to "Http".

max_upload_triple_count_per_request

Integer

Configures the number of triples per upload request.

update_execution_timeout

Long

Configures the update execution timeout for a query.

server_uri

String

Configures the server URI for http based storage backends.

relative_query_endpoint

String

Configures the query endpoint for http based storage backends (part of complete query endpoint URI).

relative_update_endpoint

String

Configures the update endpoint for http based storage backends (part of complete update endpoint URI).

dataset

String

Configures the dataset name for http based storage backends (part of the endpoint URI).

relative_data_endpoint

String

Configures the data endpoint name for http based storage backends (part of the endpoint URI)

relative_sparql_endpoint

String

Configures the SPARQL endpoint name for http based storage backends (part of the endpoint URI).

sparql_endpoint

String

Read-only. Gets access to the complete SPARQL endpoint URI.

data_endpoint

String

Read-Only. Gets access to the complete data endpoint URI.

query_endpoint

String

Read-Only. Gets access to the complete query endpoint URI.

update_endpoint

String

Read-Only. Gets access to the complete update endpoint URI.

Functions

Returned Object / Value

Description

reset()

None

Resets the code analysis cloud configuration.