Skip to content

Count code size and number of comments in .NET .CS based projects.

License

Notifications You must be signed in to change notification settings

MenaceSan/CodeCounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CodeCounter

Copyright (c) 2020 Dennis Robinson (www.menasoft.com). All rights reserved.
Licensed under the MIT License. https://opensource.org/licenses/MIT

Version 1.0.0.2

https://github.com/MenaceSan/CodeCounter.git

How big is your .cs code base?
How well commented is your code?
Count code size and number of comments in .NET .CS based projects.

This is a Windows app that inspects directories of .cs files and calculates some statistics.
There are other applications that do this sort of things but I found them overkill or difficult to use.

Ignores "<auto-generated" code.

Stats created

    [Description("Number of dirs with files. Ignore empty dirs.")]
    public int NumberOfDirectories = 0;
    [Description("Number of (not empty) source files read")]
    public int NumberOfFiles = 0;      
    [Description("Number of total characters read")]
    public long NumberOfChars = 0;      

    [Description("Number of syntax errors found in the files")]
    public int NumberOfErrors = 0;

    [Description("Total number of lines (Sum of next 6 stats)")]
    public int NumberOfLines = 0;      

    [Description("Empty or Whitespace")]
    public int NumberOfLinesBlank = 0;
    [Description("Comments that are empty or multi line quotes")]
    public int NumberOfCommentBlank = 0;
    [Description("Comment lines that look like commented out code (or junk)")]
    public int NumberOfCommentedOutCode = 0; 
    [Description("Comments that seem to contain text")]
    public int NumberOfCommentLines = 0;
    [Description("Lines that just have code")]
    public int NumberOfLinesCode = 0; 
    [Description("Lines that have code and comments")]
    public int NumberOfLinesCodeAndComment = 0;

    [Description("Number of class, struct, interface, or enum")]
    public int NumberOfClasses = 0;
    [Description("Number of classes that have a comment immediately before or after")]
    public int NumberOfClassComments = 0;
    [Description("Number of classe methods (Not properties or anon, lambda etc.)")]
    public int NumberOfMethods = 0;
    [Description("Number of methods that have a comment immediately before or after")]
    public int NumberOfMethodComments = 0;

Commands

CodeCounter walks a directory of .cs, .cpp sources and compiles some statistics.
Use: CodeCounter -flag directory
    - -verbose : show methods.
    - -tree : display methods and names as tree.
    - -showmodules : list the modules.
    - -wait : pause at the end.

TODO

License scanning similar to scancode project. https://github.com/nexB/scancode-toolkit

About

Count code size and number of comments in .NET .CS based projects.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages