Analyzer

An analyzer inspects and analyzes source code in a repository to raise issues which need attention. For example, analyzers can look for anti-patterns, style violations, bug risks, etc. and raise an issue with appropriate severity and type. Analyzers can raise file-level (like, anti-pattern found in a file at a specific location), or repository-level issues (like, 4 dependencies found which are not installed).

The following table lists all supported analyzers and their shortcodes.

Analyzer Shortcode Type
Python python Core

Python - Configuration

This section covers configuration specific to python analyzer. Please make sure to read the general configuration guide first.

name

  • Type: String
  • Presence: mandatory
  • Description: Shortcode of the analyzer.
  • Example:
name = "python"

enabled

  • Type: Boolean
  • Presence: mandatory
  • Description: Toggle whether this analyzer should be run.
  • Example:
enabled = true

runtime_version

  • Type: String
  • Presence: optional
  • Description: Runtime version in semver. Available values for python analyzer are "2.x.x" and "3.x.x". Defaults to "3.x.x"
  • Example:
runtime_version = "3.x.x"

dependency_file_paths

  • Type: Array
  • Presence: optional
  • Description: List of files that contain the list of external dependencies.
  • Example:
dependency_file_paths = [
  "dev_requirements.txt",
  "prod_requirements.txt"
]

TIP

By default requirements.txt, Pipfile, Pipfile.lock and setup.py are automatically detected and scanned for dependencies if found in the repository's root.

Python - Example

version = 1

test_patterns = [
  "tests/",
  "test_*.py"
]

[[analyzers]]
name = "python"
enabled = true
runtime_version = "3.x.x"
dependency_file_paths = [
  "requirements/development.txt"
]