Skip to content

Commit

Permalink
Merge pull request #14 from p2k-ko/per_function_metrics
Browse files Browse the repository at this point in the history
Patch for per function metrics in the detailed report; initialize with wmc1 instead of zero (contribution from p2k-ko).
  • Loading branch information
sarnold committed Apr 5, 2017
2 parents 33f1579 + 1c60f28 commit a794b38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,8 @@ cccc/cccc.cpp
cccc/java.cpp
cccc/parser.dlg

# generated test output
test/.cccc/*
test/*.html
test/*.xml
test/*.db
5 changes: 4 additions & 1 deletion cccc/cccc_htm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,6 @@ void CCCC_Html_Stream::Module_Summary(CCCC_Module *module_ptr)
{
// calculate the counts on which all displayed data will be based
// int nof=module_ptr->member_table.records(); // Number of functions
int nof=0;
int loc=module_ptr->get_count("LOC"); // lines of code
int mvg=module_ptr->get_count("MVG"); // McCabes cyclomatic complexity
int com=module_ptr->get_count("COM"); // lines of comment
Expand All @@ -1237,6 +1236,10 @@ void CCCC_Html_Stream::Module_Summary(CCCC_Module *module_ptr)
int noc=module_ptr->get_count("NOC"); // number of children
int cbo=module_ptr->get_count("CBO"); // coupling between objects

// To calculate the per function metrics in the detailed report the
// number of functions is set to the weighted methods
int nof=wmc1;

fstr << "<TABLE BORDER WIDTH=100%>" << endl
<< "<TR>" << endl;
Put_Header_Cell("Metric",70);
Expand Down

0 comments on commit a794b38

Please sign in to comment.