8000 GitHub - oNk2r/python-code-analyzer: A simple Python script to analyze code files for lines, comments, and function metrics
[go: up one dir, main page]

Skip to content

oNk2r/python-code-analyzer

Repository files navigation

python-code-analyzer

A simple Python script to analyze code files for lines, comments, and function metrics

A beginner-friendly Python tool to analyze .py files.

Features:

  • Counts total lines of code
  • Counts number of comment lines
  • Detects functions
  • Calculates comment-to-code ratio
  • Finds the longest function by line count

Usage

python analyzer.py sample_code.py

Sample Output

Analyzing: sample_code.py
Total lines: 12
Comment lines: 2
Number of functions: 2
Code to comment ratio: 16.67%
Longest function: long_function (6 lines)

About

A simple Python script to analyze code files for lines, comments, and function metrics

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0