mate_common.models.analyses module

class mate_common.models.analyses.AnalysisInfo(*, name: str, background: str)

Bases: pydantic.main.BaseModel

Represents an analysis that’s been registered with MATE.

Parameters
  • name (str) –

  • background (str) –

Return type

None

background: str

Human-readable background text for this analysis.

name: str

The human-readable name for this analysis.

class mate_common.models.analyses.AnalysisTaskInfo(*, analysis_task_id: str, analysis_name: str, build_id: str, poi_result_ids: List[str], state: mate_common.models.analyses.AnalysisTaskState)

Bases: pydantic.main.BaseModel

Represents a single POI analysis task, which may still be running and may have POI results.

Parameters
Return type

None

analysis_name: str

The name of the analysis that this task is running.

analysis_task_id: str

The unique ID of this task.

build_id: str

The unique ID of the build that this task is running against.

poi_result_ids: List[str]

The IDs of any POI results that have been produced.

state: mate_common.models.analyses.AnalysisTaskState

The state of this analysis task.

class mate_common.models.analyses.AnalysisTaskState(value)

Bases: mate_common.state_machine.StateMachineMixin, str, enum.Enum

Represents the state of an analysis task.

Completed = 'completed'
Created = 'created'
Duplicate = 'duplicate'
Failed = 'failed'
Running = 'running'
mate_common.models.analyses.FlowFinderAnnotations

A convenience type for a list of FlowFinder annotations.

alias of List[Dict[str, Any]]

class mate_common.models.analyses.FlowFinderSnapshotInfo(*, snapshot_id: str, poi_result_id: str = None, build_id: str, label: str, filters: List[str], graph_requests: GraphRequests, hidden_graph_ids: List[str], hidden_node_ids: List[str], user_annotations: Dict[str, FlowFinderAnnotations])

Bases: pydantic.main.BaseModel

Represents a snapshot of a FlowFinder analysis state.

Parameters
  • snapshot_id (str) –

  • poi_result_id (Optional[str]) –

  • build_id (str) –

  • label (str) –

  • filters (List[str]) –

  • graph_requests (GraphRequests) –

  • hidden_graph_ids (List[str]) –

  • hidden_node_ids (List[str]) –

  • user_annotations (Dict[str, FlowFinderAnnotations]) –

Return type

None

build_id: str

The ID of the build that this snapshot was created from.

filters: List[str]

A list of filters applied.

graph_requests: GraphRequests

The graph requests needed to reproduce the analysis state.

hidden_graph_ids: List[str]

The IDs of any graphs that should be hidden.

hidden_node_ids: List[str]

The IDs of any nodes that should be hidden.

label: str

A unique human-readable label for this POI snapshot.

poi_result_id: Optional[str]

The unique ID for the POI result that this snapshot was created from, if it was created from a POI result.

snapshot_id: str

The unique ID for this POI snapshot.

user_annotations: Dict[str, FlowFinderAnnotations]

A mapping of graph ids to annotations relating to this FlowFinderSnapshot

mate_common.models.analyses.GraphRequests

A convenience type for a list of FlowFinder graph requests.

alias of List[Union[mate_common.models.graphs.NodeRequest, mate_common.models.graphs.GraphRequest, mate_common.models.graphs.SliceRequest]]

class mate_common.models.analyses.POI(*, insight: str, source: str = None, sink: str = None, salient_functions: List[mate_common.models.analyses.SalientFunction] = [])

Bases: pydantic.main.BaseModel

The core representation of a Point of Interest (POI).

Parameters
Return type

None

insight: str

A human-readable piece of “insight” for the POI, in Markdown format.

salient_functions: List[mate_common.models.analyses.SalientFunction]

A list of SalientFunction models.

Each POI analysis determines which, if any, functions to include in this list.

sink: Optional[str]

A human readable location string for the “sink” of the POI.

source: Optional[str]

A human readable location string for the “source” of the POI.

class mate_common.models.analyses.POIResultComplexity(value)

Bases: str, enum.Enum

Represents the “cognitive complexity” of a POI result, corresponding roughly to the expected skill level required to correctly evaluate the result.

High = 'high'
Low = 'low'
Medium = 'medium'
Unknown = 'unknown'
class mate_common.models.analyses.POIResultInfo(*, poi_result_id: str, build_id: str, analysis_task_id: str, analysis_name: str, poi: Dict[str, Any], flagged: bool, done: bool, complexity: mate_common.models.analyses.POIResultComplexity, parent_result_id: str = None, child_result_ids: List[str], snapshot_ids: List[str], graph_requests: GraphRequests, insight: str, background: str, salient_functions: List[mate_common.models.analyses.SalientFunction])

Bases: pydantic.main.BaseModel

Represents a single POI result, as produced by an analysis task from an underlying analysis.

Parameters
  • poi_result_id (str) –

  • build_id (str) –

  • analysis_task_id (str) –

  • analysis_name (str) –

  • poi (Dict[str, Any]) –

  • flagged (bool) –

  • done (bool) –

  • complexity (mate_common.models.analyses.POIResultComplexity) –

  • parent_result_id (Optional[str]) –

  • child_result_ids (List[str]) –

  • snapshot_ids (List[str]) –

  • graph_requests (GraphRequests) –

  • insight (str) –

  • background (str) –

  • salient_functions (List[mate_common.models.analyses.SalientFunction]) –

Return type

None

analysis_name: str

The name of the analysis that produced this result.

analysis_task_id: str

The unique ID of the analysis task that produced this result.

background: str

A string of background information relating to this type of POI.

build_id: str

The unique ID of the build that this result applies to.

child_result_ids: List[str]

Any “child” POI results that were created as a result of this POI result.

complexity: mate_common.models.analyses.POIResultComplexity

The estimated cognitive complexity of the POI result.

done: bool

True if this POI result has been toggled to done in the UI, False otherwise.

flagged: bool

True if this POI result has been toggled to flagged in the UI, False otherwise.

graph_requests: GraphRequests

A list of objects representing graph requests.

insight: str

A textual description of the POI.

This is usually formatted as Markdown.

parent_result_id: Optional[str]

The ID of the “parent” POI result, if this POI result was created from a parent.

poi: Dict[str, Any]

The raw POI result.

poi_result_id: str

The unique ID for this POI result.

salient_functions: List[mate_common.models.analyses.SalientFunction]

A list of functions that are “salient” i.e. are traversed by this POI result.

This list may be empty.

snapshot_ids: List[str]

Any snapshots that have been created from this POI result.

class mate_common.models.analyses.SalientFunction(*, cpg_id: str, demangled_name: str, name: str)

Bases: pydantic.main.BaseModel

A collection of identifiers for a function that’s been deemed “salient” by a POI result.

Parameters
  • cpg_id (str) –

  • demangled_name (str) –

  • name (str) –

Return type

None

class Config

Bases: object

frozen = True
cpg_id: str

The function’s unique ID within its CPG.

demangled_name: str

The function’s demangled name. This name may not be unique, as demangling can be destructive.

name: str

The function’s name, which may be mangled. This name should be unique.