Skip to content
Alim ÖZDEMİR edited this page Apr 9, 2018 · 3 revisions

The project have two probes. Those are CodeChanges and StaticAnalysis. You can see the probe structure at Probe.cs

Example probe

{
    "Id": "4fd9390d-0cae-41e1-95c3-85a1b1e94e69",
    "ProbeType": "StaticAnalysis",
    "Object": {
      "Name": "metricTest",
      "Path": "sum.js",
      "Type": "function"
    },
    "Modifiers": null,
    "CreationDate": "2018-02-07T01:03:07.334765+03:00",
    "Metrics": {
      "Strategy": "Always",
      "Arguments": [
        "max-depth: [\"error\", 2]",
        "complexity: [\"error\", 2]"
      ]
    }
  }

A repository must have .triggr folder at the top level of repository. That folder contains json files as above with any file name. You can see an example repository from here.

Flow

Before the probe activity, the system is extract the object information or itself from file path. This approach only activated with when LanguageProperties.FullProject = false.

CodeChanges

It is basically comparing the old version and the new version of object as strings.

StaticAnalysis

In the project I have setup two static analysis tool for JavaScript and Python.

JavaScript

I have used ESLint for static analysis tool of JavaScript.

eslint filepath --rule "max-depth: [\"error\", 2]"

Python

Pylint is static analysis tool for Python programming language.

pylint filepath
Clone this wiki locally