The_Project

0
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
3 месяца назад
README.md

Code Quality Assessor

Tests

Description

Automated tool for comprehensive Python code quality analysis in educational contexts. Evaluates code across multiple dimensions including style compliance, complexity metrics, documentation coverage, and maintainability indicators.

Designed for grading programming assignments and providing automated feedback to students.

Installation

Prerequisites

  • Python 3.8 or higher
  • pip or conda package manager

Setup

Usage

Analyze a single file

Example output:

Analyzing 1 file(s)... Analyzing: data/samples/good_code.py Score: 92.5/100 Recommendations: 3 Text report saved to: reports/good_code_report.txt

Analyze a directory

Example output:

Analyzing directory: src/ Total files: 3 Analyzed: 3 Average score: 74.3/100 Best score: 92.5/100 Worst score: 32.5/100 Text report: reports/directory_report.txt HTML report: reports/directory_report.html JSON report: reports/directory_report.json

Generate HTML report

Compare multiple files

Example output:

Comparing files... Comparison Summary: Best File: good_code.py (94.0/100) Worst File: bad_code.py (32.5/100) Average Score: 73.3/100

Project Structure

code-quality-assessor/ ├── src/ # Source code modules │ ├── __init__.py │ ├── analyzer.py # Main analysis engine │ ├── complexity.py # Code complexity analysis │ ├── metrics.py # Quality metrics calculation │ └── reporters.py # Report generation ├── tests/ # Unit tests │ ├── __init__.py │ ├── test_analyzer.py │ └── test_metrics.py ├── data/samples/ # Sample code for demonstration │ ├── good_code.py │ ├── medium_code.py │ └── bad_code.py ├── scripts/ │ └── assess.py # Command-line interface ├── .github/workflows/ # CI/CD configurations │ ├── tests.yml │ └── scheduled-analysis.yml ├── .gitignore ├── requirements.txt └── README.md

Requirements

  • Python >= 3.8
  • numpy >= 1.20.0
  • pandas >= 1.3.0
  • radon >= 5.1.0
  • flake8 >= 4.0.0
  • black >= 22.0.0
  • pylint >= 2.13.0
  • pytest >= 7.0.0
  • pytest-cov >= 3.0.0
  • matplotlib >= 3.4.0

Testing

Run tests:

Run tests with coverage:

CI/CD

This project uses GitHub Actions for automated testing and scheduled code quality analysis.

  • Tests workflow: Runs on every push, testing on Python 3.8, 3.9, and 3.10 with coverage reports
  • Scheduled analysis: Runs daily to analyze sample code with report generation and artifact uploads

License

MIT License