Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

oNk2r/python-code-analyzer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

7 Commits

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

AltStyle によって変換されたページ (->オリジナル) /