CMetrics measures size and complexity for C files

Overview
C metrics package
=================

INSTALL
-------

see INSTALL file

USAGE
-----

cmetrics [-h] [-f] [-p] [-n] target_dir

positional arguments:
  target_dir       directory with sources (recursively scanned)

optional arguments:
  -h, --help       show this help message and exit
  -f, --functions  show metrics for functions instead of files
  -p, --path       show full file path in the last column
  -n, --no-header  do not show metrics names in the first row
	  

HOW TO INTERPRET THE OUTPUT OF CMETRICS
---------------------------------------

CMetrics measures size and complexity for C files. The metrics are the
following:

 SLOC    Source Lines of Code (text lines excluding blanks and
         comments)
 LOC	 Text lines in the source code file (including blanks, etc)
 BLANK	 Number of blank lines
 COM.L	 Number of lines that are exclusively comments (no code)
 COM.N	 Number of comments in the file (a comment can be multiline)
 H.LEN	 Halstead's Length
 H.VOL	 Halstead's Volume
 H.LEVEL Halstead's Level
 H MEN.D Halstead's number of mental discriminations
 MAXCY	 Maximum McCabe's cyclomatic complexity (between all the
         functions)
 MINCY	 Minimum McCabe's cyclomatic complexity
 AVGCY	 Average McCabe's cyclomatic complexity
 MEDCY	 Median McCabe's cyclomatic complexity
 TOTCY	 Total McCabe's cyclomatic complexity (sum of all functions)

If you use the '-f' option, you will get info for functions instead of
files. If the function name is "***", it means that it is code outside
of the scope of functions but inside the file. The available metrics
are:

 SLOC    Source Lines of code
 CYCLO	 McCabe's cyclomatic complexity
 RETURN	 Number of exit points in the function

COPYRIGHT INFO
--------------

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or (at
your option) any later version.

See the COPYING file for details.

(c) 2007-2011 Israel Herraiz

Imported from the C Metrics package by Brian Renaud.

It has been "adopted" by Libresoft with permission of the original
author, and it is now part of the Libresoft-tools project.

Check https://github.com/MetricsGrimoire/CMetrics for details

You might also like...
Refinements of the WFA alignment algorithm with better complexity

wfalm Refinements of the WFA alignment algorithm with better complexity Introduction This repository contains implementations of the WFA algorithm as

Open hardware to measure EC and pH, drive pumps, and otherwise manage a mid-size hydroponic grow over Wi-Fi.
Open hardware to measure EC and pH, drive pumps, and otherwise manage a mid-size hydroponic grow over Wi-Fi.

Hydromisc This is a single PCBA with all the necessary I/O to automate a typical small to mid-size hydroponic grow, controllable over Wi-Fi

Browser and NodeJS Web Assembly audio decoder libraries that are highly optimized for size and performance.

WASM Audio Decoders WASM Audio Decoders is a collection of Web Assembly audio decoder libraries that are highly optimized for browser use. Each module

A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iterating over those.

cpp_enum_set A library of type safe sets over fixed size collections of types or values, including methods for accessing, modifying, visiting and iter

Shared to msvcrt.dll or ucrtbase.dll and optimize the C/C++ application file size.
Shared to msvcrt.dll or ucrtbase.dll and optimize the C/C++ application file size.

VC-LTL - An elegant way to compile lighter binaries. 简体中文 I would like to turn into a stone bridge, go through 500 years of wind, 500 years of Sun, ra

My new zigbee project. Wireless temperature and humidity mini sensor with electronic ink display 2.13 inches, low power consumption, compact size, enclosure with magnets.
My new zigbee project. Wireless temperature and humidity mini sensor with electronic ink display 2.13 inches, low power consumption, compact size, enclosure with magnets.

My new zigbee project. Wireless temperature and humidity mini sensor with electronic ink display 2.13 inches, low power consumption, compact size, enclosure with magnets. The device use SHTC3 sensors, chip CC2530, battery CR2477.

Protocol Buffers with small code size

Nanopb - Protocol Buffers for Embedded Systems Nanopb is a small code-size Protocol Buffers implementation in ansi C. It is especially suitable for us

A variation CredBandit that uses compression to reduce the size of the data that must be trasnmitted.

compressedCredBandit compressedCredBandit is a modified version of anthemtotheego's proof of concept Beacon Object File (BOF). This version does all t

OSA a is minisatellite/ space probe the size of a can designed to participate in the ESA CanSat 2021 competition 🛰️ 📡 .
OSA a is minisatellite/ space probe the size of a can designed to participate in the ESA CanSat 2021 competition 🛰️ 📡 .

Project OSA OSA a is minisatellite/ space probe the size of a can designed to participate in the ESA CanSat 2021 competition 🛰️ 📡 . Our project is c

ipcbuf - test/report the size of an IPC kernel buffer

ipcbuf - test/report the size of an IPC kernel buffer Different forms of IPC utilize different in-kernel buffers, depending on a variety of possibly s

CodeCompactor is an open source program designed for reducing the size of your code!

CodeCompacter An exciting, new and open source program for reducing the length of your code! Usage: ./CodeCompacter {ARGUMENTS} Arguments: -L {languag

esp32s2 implement a  usb port display with 320*240 size with ~13pfs
esp32s2 implement a usb port display with 320*240 size with ~13pfs

esp32s2_usb_display overview it's a USB mini display for Linux platform, such as raspberry Pi, Centos X86 server. it refer many opensource projects: r

Tiny - low-level library for minimizing the size of your types
Tiny - low-level library for minimizing the size of your types

foonathan/tiny Note: This project is currently WIP, no guarantees are made until an 0.1 release. This project is a C++11 library for putting every las

A size-optimized STL implementation.

uSTL This library is obsolete. Please use the official gcc C++ standard library. uSTL is a partial implementation of the C++ standard library that foc

An indie game marketing size guide for social media presence

BRINDIE FREE - an .ai sourcefile with sizes for art assets needed to create Facebook page, Twitter profile, Steam Store page and Steam Developer page

Creates 3D lithophanes from image files, exports them to stl files, ready for slicing and 3D printing.

LithoMaker Creates 3D lithophanes from PNG image files and exports them to STL files, ready for slicing and 3D printing. Download the latest release h

This program converts ASCII STL files to RT files for miniRT.

STL to RT This program converts ASCII STL files to RT files for miniRT. Input the ASCII STL file to the standard input and output the RT file from the

Comments
  • execute fail

    execute fail

    Environment: Ubuntu 18.04 gcc verison: 7.5.0

    nathan@ubuntu:~/audio/CMetrics$ ./cmetrics -h -f /home/nathan/S1/s1_app/ File "./cmetrics", line 190 print template.format("FILE", "SLOC", "LOC", "FUNCS", "BLANK", "COM.L", "COM.N", "H LEN", "H VOL", "H LEVEL", "H MEN. D.", "MAXCY", "MINCY", "AVGCY", "MEDCY", "TOTCY",) ^ SyntaxError: invalid syntax

    opened by nathan-yangling 2
Owner
Metrics Grimoire
Metrics Grimoire
A tool for use with clang to analyze #includes in C and C++ source files

Include What You Use For more in-depth documentation, see docs. Instructions for Users "Include what you use" means this: for every symbol (type, func

null 3.2k Jan 4, 2023
A static analyzer for Java, C, C++, and Objective-C

Infer Infer is a static analysis tool for Java, C++, Objective-C, and C. Infer is written in OCaml. Installation Read our Getting Started page for det

Facebook 13.8k Jan 4, 2023
Analysis of Argon and Xenon Collision data to test Bardeen-Cooper-Schrieffer Approximation

Univeristy of North Carolina Wilmington Analysis of Argon and Xenon Collision data to test Bardeen-Cooper-Schrieffer Approximation. Argon Data Tree Fi

William Jarratt 0 Aug 25, 2022
Flint++ is cross-platform, zero-dependency port of flint, a lint program for C++ developed and used at Facebook.

Flint++ A Cross Platform Port of Facebook's C++ Linter Flint++ is cross-platform, zero-dependency port of flint, a lint program for C++ developed and

Joss Whittle 255 Dec 10, 2022
Complete introduction to size balanced trees (O(1) amortized complexity)

Size Balanced Tree A size balanced tree (SBT) is a self-balancing binary search tree (SBBST) rebalanced by examining the sizes of each node's subtrees

Jishan Shaikh 19 Dec 7, 2022
Header-only C++11 library to handle physical measures

cpp-measures Header-only C++11 library to handle physical measures License: This project is released under the Mozilla Public License 2.0. Purpose Thi

Carlo Milanesi 20 Jun 28, 2018
Seidel's Algorithm: Linear-Complexity Linear Programming for Small-Dimensional Variables

SDLP Seidel's Algorithm: Linear-Complexity Linear Programming (LP) for Small-Dimensions About This solver is super efficient for small-dimensional LP

ZJU FAST Lab 43 Dec 19, 2022
This is the code that powers FiniteCurve.com, a TSP art style generator without the NP-hard complexity.

FiniteCurve.com -- TSP art on a CPU budget This is the code that powers FiniteCurve.com, a TSP art style generator without the NP-hard complexity. For

Vidar Holen 11 Dec 22, 2022
MPEG-H 3D Audio Low Complexity Profile Decoder

Introduction of the MPEG-H 3D Audio Low Complexity Profile Decoder The advent of object-based audio and scene-based audio has revolutionized the 3D so

Ittiam Systems Pvt. Ltd. 55 Dec 8, 2022
A tool to calculate cyclomatic complexity

Feature: python 3.10.0 is required calculate cyclomatic complexity of a program (python) generate ast from source code with the help of tree-sitter su

null 1 Mar 3, 2022