xenon


Namexenon JSON
Version 0.9.1 PyPI version JSON
download
home_pagehttps://xenon.readthedocs.org/
SummaryMonitor code metrics for Python on your CI server
upload_time2023-08-12 17:24:37
maintainer
docs_urlNone
authorMichele Lacchia
requires_python
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            xenon
=====

.. image:: https://img.shields.io/travis/rubik/xenon/master.svg
    :alt: Travis-CI badge
    :target: https://travis-ci.org/rubik/xenon

.. image:: https://img.shields.io/coveralls/rubik/xenon/master.svg
    :alt: Coveralls badge
    :target: https://coveralls.io/r/rubik/xenon?branch=master

.. image:: https://img.shields.io/pypi/v/xenon.svg
    :alt: PyPI latest version badge
    :target: https://pypi.python.org/pypi/xenon/

.. image:: https://img.shields.io/pypi/format/xenon.svg
    :alt: Download format
    :target: http://pythonwheels.com/

.. image:: https://img.shields.io/pypi/l/xenon.svg
    :alt: Xenon license
    :target: https://pypi.python.org/pypi/xenon/


----

Xenon is a monitoring tool based on `Radon <https://github.com/rubik/radon/>`_.
It monitors your code's complexity.  Ideally, Xenon is run every time you
commit code. Through command line options, you can set various thresholds for
the **complexity** of your code. It will fail (i.e. it will exit with a
non-zero exit code) when any of these requirements is not met.

Installation
------------

With Pip:

.. code-block:: sh

   $ pip install xenon

Or download the source and run the setup file (requires setuptools):

.. code-block:: sh

   $ python setup.py install

Xenon is tested with all versions of Python from **2.7** to **3.6** as well as
**PyPy**.

Usage
-----

Typically you would use Xenon in two scenarios:

1. As a ``git commit`` hook: to make sure that your code never exceeds some
   complexity values.

2. On a **continuous integration** server: as a part of your build, to keep
   under control, as above, your code's complexity. See Xenon's
   `.travis.yml file`_ for an example usage.

The command line
++++++++++++++++

Everything boils down to Xenon's command line usage.
To control which files are analyzed, you use the options ``-e, --exclude`` and
``-i, --ignore``. Both accept a comma-separated list of glob patterns. The
value usually needs quoting at the command line, to prevent the shell from
expanding the pattern (in case there is only one). Every filename is matched
against the *exclude* patterns. Every directory name is matched against the
*ignore* patterns.  If any of the patterns matches, Xenon won't even descend
into them.

The actual threshold values are defined through these options:

* ``-a, --max-average``: Threshold for the *average* complexity (across all the
  codebase).
* ``-m, --max-modules``: Threshold for *modules* complexity.
* ``-b, --max-absolute``: *Absolute* threshold for *block* complexity.


All of these options are inclusive.

An actual example
+++++++++++++++++

.. code-block:: sh

   $ xenon --max-absolute B --max-modules A --max-average A

or, more succinctly:

.. code-block:: sh

   $ xenon -b B -m A -a A

With these options Xenon will exit with a non-zero exit code if any of the
following conditions is met:

* At least one block has a rank higher than ``B`` (i.e. ``C``, ``D``, ``E`` or
  ``F``).
* At least one module has a rank higher than ``A``.
* The average complexity (among all of the analyzed blocks) is ranked with
  ``B`` or higher.

Other resources
---------------

For more information regarding cyclomatic complexity and static analysis in
Python, please refer to Radon's documentation, the project on which Xenon is
based on:

* More on cyclomatic complexity:
  http://radon.readthedocs.org/en/latest/intro.html
* More on Radon's ranking:
  http://radon.readthedocs.org/en/latest/commandline.html#the-cc-command


.. _.travis.yml file: https://github.com/rubik/xenon/blob/master/.travis.yml

            

Raw data

            {
    "_id": null,
    "home_page": "https://xenon.readthedocs.org/",
    "name": "xenon",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "",
    "author": "Michele Lacchia",
    "author_email": "michelelacchia@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/6c/1c/2f0d1c76f75afc06e11757d5983a7abad101d9d92da0570956042e93c215/xenon-0.9.1.tar.gz",
    "platform": "any",
    "description": "xenon\n=====\n\n.. image:: https://img.shields.io/travis/rubik/xenon/master.svg\n    :alt: Travis-CI badge\n    :target: https://travis-ci.org/rubik/xenon\n\n.. image:: https://img.shields.io/coveralls/rubik/xenon/master.svg\n    :alt: Coveralls badge\n    :target: https://coveralls.io/r/rubik/xenon?branch=master\n\n.. image:: https://img.shields.io/pypi/v/xenon.svg\n    :alt: PyPI latest version badge\n    :target: https://pypi.python.org/pypi/xenon/\n\n.. image:: https://img.shields.io/pypi/format/xenon.svg\n    :alt: Download format\n    :target: http://pythonwheels.com/\n\n.. image:: https://img.shields.io/pypi/l/xenon.svg\n    :alt: Xenon license\n    :target: https://pypi.python.org/pypi/xenon/\n\n\n----\n\nXenon is a monitoring tool based on `Radon <https://github.com/rubik/radon/>`_.\nIt monitors your code's complexity.  Ideally, Xenon is run every time you\ncommit code. Through command line options, you can set various thresholds for\nthe **complexity** of your code. It will fail (i.e. it will exit with a\nnon-zero exit code) when any of these requirements is not met.\n\nInstallation\n------------\n\nWith Pip:\n\n.. code-block:: sh\n\n   $ pip install xenon\n\nOr download the source and run the setup file (requires setuptools):\n\n.. code-block:: sh\n\n   $ python setup.py install\n\nXenon is tested with all versions of Python from **2.7** to **3.6** as well as\n**PyPy**.\n\nUsage\n-----\n\nTypically you would use Xenon in two scenarios:\n\n1. As a ``git commit`` hook: to make sure that your code never exceeds some\n   complexity values.\n\n2. On a **continuous integration** server: as a part of your build, to keep\n   under control, as above, your code's complexity. See Xenon's\n   `.travis.yml file`_ for an example usage.\n\nThe command line\n++++++++++++++++\n\nEverything boils down to Xenon's command line usage.\nTo control which files are analyzed, you use the options ``-e, --exclude`` and\n``-i, --ignore``. Both accept a comma-separated list of glob patterns. The\nvalue usually needs quoting at the command line, to prevent the shell from\nexpanding the pattern (in case there is only one). Every filename is matched\nagainst the *exclude* patterns. Every directory name is matched against the\n*ignore* patterns.  If any of the patterns matches, Xenon won't even descend\ninto them.\n\nThe actual threshold values are defined through these options:\n\n* ``-a, --max-average``: Threshold for the *average* complexity (across all the\n  codebase).\n* ``-m, --max-modules``: Threshold for *modules* complexity.\n* ``-b, --max-absolute``: *Absolute* threshold for *block* complexity.\n\n\nAll of these options are inclusive.\n\nAn actual example\n+++++++++++++++++\n\n.. code-block:: sh\n\n   $ xenon --max-absolute B --max-modules A --max-average A\n\nor, more succinctly:\n\n.. code-block:: sh\n\n   $ xenon -b B -m A -a A\n\nWith these options Xenon will exit with a non-zero exit code if any of the\nfollowing conditions is met:\n\n* At least one block has a rank higher than ``B`` (i.e. ``C``, ``D``, ``E`` or\n  ``F``).\n* At least one module has a rank higher than ``A``.\n* The average complexity (among all of the analyzed blocks) is ranked with\n  ``B`` or higher.\n\nOther resources\n---------------\n\nFor more information regarding cyclomatic complexity and static analysis in\nPython, please refer to Radon's documentation, the project on which Xenon is\nbased on:\n\n* More on cyclomatic complexity:\n  http://radon.readthedocs.org/en/latest/intro.html\n* More on Radon's ranking:\n  http://radon.readthedocs.org/en/latest/commandline.html#the-cc-command\n\n\n.. _.travis.yml file: https://github.com/rubik/xenon/blob/master/.travis.yml\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Monitor code metrics for Python on your CI server",
    "version": "0.9.1",
    "project_urls": {
        "Download": "https://pypi.python.org/xenon/",
        "Homepage": "https://xenon.readthedocs.org/"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "fbb1a6658c1078ce5da112acc3f1476fc187813ba23521595ae3f8165b265032",
                "md5": "0105a778ac55ad5c6e8df9fa7a3e31f9",
                "sha256": "b2888a5764ebd57a1f9f1624fde86e8303cb30c686e492f19d98867c458f7870"
            },
            "downloads": -1,
            "filename": "xenon-0.9.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0105a778ac55ad5c6e8df9fa7a3e31f9",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 8506,
            "upload_time": "2023-08-12T17:24:35",
            "upload_time_iso_8601": "2023-08-12T17:24:35.599355Z",
            "url": "https://files.pythonhosted.org/packages/fb/b1/a6658c1078ce5da112acc3f1476fc187813ba23521595ae3f8165b265032/xenon-0.9.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6c1c2f0d1c76f75afc06e11757d5983a7abad101d9d92da0570956042e93c215",
                "md5": "75cb95fe3f3030d3ec9d6cbf80efe17f",
                "sha256": "d6745111c3e258b749a4fd424b1b899d99ea183cea232365ee2f88fe7d80c03b"
            },
            "downloads": -1,
            "filename": "xenon-0.9.1.tar.gz",
            "has_sig": false,
            "md5_digest": "75cb95fe3f3030d3ec9d6cbf80efe17f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9187,
            "upload_time": "2023-08-12T17:24:37",
            "upload_time_iso_8601": "2023-08-12T17:24:37.376633Z",
            "url": "https://files.pythonhosted.org/packages/6c/1c/2f0d1c76f75afc06e11757d5983a7abad101d9d92da0570956042e93c215/xenon-0.9.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-12 17:24:37",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "xenon"
}
        
Elapsed time: 0.10294s