#programming-language #language #statistics #programming #analysis #code

bin+lib codstts

A code statistics tool that analyzes programming language distribution in projects

1 unstable release

new 0.1.0 Jan 26, 2025

#994 in Development tools

Download history 90/week @ 2025-01-22

90 downloads per month

MIT license

28KB
577 lines

Codstts

Codstts License Rust Version

English | 中文

🌟 Overview

A code statistics tool written in Rust that analyzes programming language distribution in projects.

🚀 Features

  • Multiple programming language recognition
  • Simple and detailed display modes
  • Customizable configuration
  • Accurate code, comment, and blank line counting
  • Beautiful command-line interface
  • Support for .gitattributes language overrides
  • Ignores common binary files, documentation, and configuration files

Installation

cargo install codstts

Usage

Basic usage:

# Analyze current directory
codstts

# Use simple mode
codstts -s

# Use detailed mode
codstts -d

# Analyze specific directory
codstts path/to/your/project

Configuration

You can create a .codstts.toml file in your project root for custom configuration:

# Paths to ignore
ignore_paths = ["vendor", "node_modules"]

# Language mappings
[language_mappings]
"jsx" = "React"
"tsx" = "React"

# Extensions to exclude
exclude_extensions = ["log", "tmp"]

# Files to exclude
exclude_files = ["LICENSE", "README.md"]

Output Examples

Simple mode:

Languages
██████████████████████████████████████████████████

● Python 62.1% (15666 bytes)
● JavaScript 16.1% (4046 bytes)CSS 13.9% (3504 bytes)HTML 7.3% (1836 bytes)
● Shell 0.6% (149 bytes)

Detailed mode includes additional information such as code lines, comment lines, etc.

License

This project is open-sourced under the MIT

Contributing

Issues and Pull Requests are welcome!

Dependencies

~8–17MB
~210K SLoC