Skip to main content

Code Quality And Security (cqas)

Python Code Quality and Security (CQaS) tester

CQaS (Code Quality And Security) is a Python CLI tool intended to scan and report on the quality, security, maintainability, and technical debt potential of Python codebases and files. It helps developers, teams, and pipelines make their Python projects have high standards for code quality as well as reduce risk caused by bugs, vulnerabilities, and unmaintainable code.

This tool is meant primarily for educational purposes. I made this to be used in my maturity/graduation work.

Installation

  • For users: pip install --user --upgrade cqas (for coloured output: pip install --user --upgrade cqas[colour])
  • For development: pip install --upgrade -e . (or .[colour])

Documentation

All the documentation can be found in the source code repository.

Usage

usage: cqas [-h] [--json] [--output OUTPUT] [--colour] [--no-colour]
            [--top-n TOP_N] [--max-files MAX_FILES]
            [--min-severity {LOW,MEDIUM,HIGH,CRITICAL}] [--feedback]
            [--verbose] [--quiet] [--lang {en,lt}]
            path

Code Quality and Security Analyser (CQaS)

positional arguments:
  path                  Python file or directory to analyse

options:
  -h, --help            show this help message and exit

Output Options:
  --json, -j            Output results in JSON format
  --output, -o OUTPUT   Output file to save results
  --colour, --color, -c
                        Enable coloured output (default: enabled)
  --no-colour, --no-color, -C
                        Disable coloured output
  --top-n, -n TOP_N     Top N statistics

Analysis Options:
  --max-files, -m MAX_FILES
                        Maximum number of files to analyse (default: 1000)
  --min-severity, -s {LOW,MEDIUM,HIGH,CRITICAL}
                        Minimum security issue severity to include (default:
                        LOW)
  --lang, -l {en,lt}    Natural language of choice (default: en)

Reporting Options:
  --feedback, -f        Generate actionable recommendations and feedback
  --verbose, -v         Verbose output with progress tracking
  --quiet, -q           Suppress progress messages

Examples:
  cqas myfile.py                       # Analyse single file
  cqas src/ -v                         # Analyse directory with progress
  cqas . --json --output report.json   # JSON output to file
  cqas project/ -p --colour            # Project analysis with colours
  cqas app.py -s HIGH -v               # High severity issues only
  cqas . -p -f --max-files 500         # Full analysis with recommendations

Features

  • Individual and Project-level scans: Allows users to select and scan either whole projects or individual files.
  • Comprehensive Code Quality Metrics: Measures cyclomatic and cognitive complexity, Halstead metrics, maintainability index, readability scores, PEP8 compliance, and technical debt estimations.
  • Security Vulnerability Detection: Detects security issues with severity counts, combining static analysis methods.
  • Dead Code Identification: Finds potential dead code segments to improve code health.
  • Duplication Detection: Analyses source duplication within and across files and calculates duplication percentages.
  • Import Analysis: Reports on standard library, third-party, local, and circular imports for dependency insights.
  • Complexity Hotspots: Identifies and ranks functions and classes with high cyclomatic complexity.
  • Files Requiring Attention: Highlights files with high issue scores, showing breakdown by quality, security, maintainability, complexity, technical debt, and issue counts.
  • Technical Debt Analysis: Estimates total technical debt in hours and average debt ratios, providing focused file debt breakdowns.
  • Quality, Complexity, and Maintainability Distributions: Aggregated quality scores, complexity levels, and maintainability categories with clear distributions.
  • Actionable Recommendations: Suggests practical next steps to improve code quality based on analysis results.
  • Colourful Console Reporting: Uses contextual colour coding for scores, counts, ratios, and categories for enhanced readability.
  • Efficient and Scalable: Limits analysis to a configurable number of files and supports progress indication during scanning.
  • Extensible Architecture: Modular analysers for extensibility and independent evolution of complexity, security, duplication, and style modules.
  • Multi-Language support: Support for multiple natural languages, including English and Lithuanian.

Metadata

Release files for cqas 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for cqas 2.0.0
File Interpreter ABI Platform
cqas-2.0.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Release files / cqas-2.0.0-py2.py3-none-any.whl

Download URL cqas-2.0.0-py2.py3-none-any.whl
Size 64.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
aa9600a93f83906b9e93017c5d7ed0200fdd0d88f16f0c44790768de869de15b
BLAKE2b-256 checksum
How to use checksums
46e2d8788ee28d6fd84d8d04d536e62e3b4b08c6236b155d216b8950d9e9458b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

1 release file

1.1.0

1 release file

1.0.3

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page