bright-tools / ccsm Goto Github PK
View Code? Open in Web Editor NEWC Code Source Metrics - tool to gather simple metrics from C code
License: Apache License 2.0
C Code Source Metrics - tool to gather simple metrics from C code
License: Apache License 2.0
Afferent Couplings (Ca): The number of other packages that depend upon classes within the package is an indicator of the package's responsibility.
Classes should be metric types with number of methods, member variables, etc as metrics
HIS definition:
"Number of Instructions per function „STMT“"
Statement
An action that can be implemented on an individual basis.
(Source [ISO/IEC 9899:1999]; Kapitel 6.8: „A statement specifies an action to be performed.“)
m_metricShortNames, m_metricNames, m_metricApplies, etc could be wrapped up into a struct or class, with an array of such classes representing the information currently located in each disparate array.
HIS definition:
"Depth of nesting of a function. "
Can associated comments to functions - add this.
Macros are often used as a form of encapsulation, hence in some cases the user may want to count the metrics associated with a macro definition rather than include the macro expansion in the method/function.
Efferent Couplings (Ce): The number of other packages that the classes in the package depend upon is an indicator of the package's independence.
In the def file idiom, the same file is included multiple times, generally with a different macro definition such that the pre-processor will token-replace the included file differently in each instance.
This brings up the question of how metrics associated with this file should be handled ...
HIS definition:
"Relationship of the number of comments (outside of and within functions) to the number of statements".
Some metrics (e.g. McCabe complexity) don't mean anything in the way there're currently summed and presented at file/global levels.
Simple GUI for people who don't want to use the command line
HIS definition:
"Number of return points within a function"
0 = a function without a specific return statement
HIS definition:
"Number of Function Parameters "
e.g. number of external functions/variables accessed?
How would this work for C++ with class implementation in headers?
HIS definition:
"How many different functions does this function call? Calling the same subfunction counts only once."
e.g.
int get_foo( void )
{
return 1;
}
int array_thing[ (1>2)?4:7 ];
get_foo() will be attributed with containing a ternary operator.
Say we have something like this:
Header.h
extern int mex;
# if defined FOO
extern int foo;
# undef FOO
# include "header.h"
# else
extern int moo;
# endif
Where a file effectively includes itself, this may not be handled correctly by CCSM at the moment - CCSM is likely to process the file twice resulting in the metric count being artificially inflated.
HIS definition:
"By how many subfunctions is this function called?"
HIS definition:
"Number of non cyclic remark paths (i.e. minimum number of necessary cases of test) "
HIS definition:
"The language scope is an
indicator of the cost of
maintaining/changing functions.
VOCF = (N1 + N2) / (nl + n2),
where
nl = Number of different operators
N1 = Sum of all Operators
n2 = Number of different Operands
N2 = Sum of all Operands
Report min/max median in dump?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.