200

Language: Python
Checks: 1
Categories: Compexity
Radon Version: 1.4.2 (version 4.3.2 available via beta channel)

Radon provides Cyclomatic Complexity checks on both Python 2 and Python 3 code.

Enable the Plugin

To enable Radon analysis, add the following to your .codeclimate.yml configuration file:

plugins:
  radon: 
    enabled: true

More information about the CLI is available in the README here: https://github.com/codeclimate/codeclimate

Configure the Plugin

Radon defaults to assuming the target project is written for Python 3 but can be configured to use Python 2 syntax by specifying python_version in your .codeclimate.yml:

plugins:
  radon: 
    enabled: true
    config: 
      python_version: 2

The Radon engine can be configured to only report issues over (and including) a configured radon Grade threshold. If no threshold is specified, Radon defaults to a "B".

A threshold can be specified in your .codeclimate.yml as follows:

plugins:
  radon: 
    enabled: true
    config: 
      threshold: "C"

The threshold represents the lower bound of complexity scores reported.

For instance, if your radon engine is configured with a threshold of "B", any block of code with a Cyclomatic Complexity of 6 or greater will be reported as an issue.

Using Radon's newer versions

A newer version of Radon is available by specifying the beta channel in your .codeclimate.yml:

plugins:
  radon:
    enabled: true
    channel: beta