Coder Social home page Coder Social logo

repo-stats's Introduction

Repository statistics

Collects various repository statistics such as files count by type or lines of code.

Installation

Just clone this repo:

git clone https://github.com/mximp/repo-stats.git

Usage

As Python module:

python -m stats -i ".java" -i ".py" /path/to/repo/  

Output example:

Repo: /path/to/repo
Inclusions spec: ('.java',)
Exclusions spec: ()
Files total: 63
Extensions excluded: {'', '.properties', '.md', '.xml', '.class', '.pack', '.jar', '.yml', '.sample', '.lst', '.iml', '.idx'}
Files matched: 2
Files excluded: 61
LoC total: 89
LoC avg: 44.5
LoC max: 82
Classes: 13
Extensions (LoC/max/avg): {'.java': (89, 82, 44.5)}

Stats

The following statistics is being collected:

  • Files total: total number of files found in the repo
  • Files matched: number of files which matched provided criteria, i.e. inclusion/exclusion spec
  • LoC total: total lines within matched files
  • LoC avg: average number of lines per file across all matched files
  • LoC max: maximum number of lines in a file acrosss all matched files
  • Classes: number of classes found in matched files (.java and .py supported)
  • Extensions: total, max, and average LoC per file extension.

repo-stats's People

Contributors

mximp avatar

Watchers

 avatar

repo-stats's Issues

Add count of only matched files

Currently the report prints only overall files count.
It would be good to see also total number of files which matched inclusion/exclusion filters.

Add average/maximum LoCs

It would be good to calculate average and maximum LoCs.
Need to be calculated total and per file type.

Wrap `stat` command by CLI

The module is now run as script with all args hardcoded.
Make it proper CLI interface.

Call example:

python -m stats /path/to/repo -i ".java .py" -e ".xml"

Click can be used for arg parsing.

Count files and lines of code

For given folder we want to calculate a number of files (recursively) as well as LoC per file extension.
The result is to be printed into console

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.