---
# System prepended metadata

title: Analiza programów przy użyciu CCCC

---

# Analiza programów przy użyciu CCCC
###### Testowanie gier | Zestaw 3 | Maciej Witkowski 321768 | Paweł Karaś 321666

# Co to jest CCCC?

CCCC jest narzędziem do analizy kodu źródłowego w różnych językach (głównie C++), które generuje raport w formacie HTML na temat różnych pomiarów przetwarzanego kodu. 


:::spoiler **Przykładowa analiza kodu**
Report on software metrics
</TITLE>
<TABLE BORDER WIDTH=100%>
<TR><TH COLSPAN=2>
CCCC Software Metrics Report
<BR> generated Thu Apr  7 14:13:35 2022

</TR>
<TR>
<TH><H4><A HREF="#projsum">Project Summary</A></H4></TH>
<TD>
Summary table of high level measures summed over all files processed in the current run.
</TR>
<TR>
<TH><H4><A HREF="#procsum">Procedural Metrics Summary</A></H4></TH>
<TD>
Table of procedural measures (i.e. lines of code, lines of comment, McCabe's cyclomatic complexity summed over each module.
</TR>
<TR>
<TH><H4><A HREF="#oodesign">Object Oriented Design</A></H4></TH>
<TD>
Table of four of the 6 metrics proposed by Chidamber and Kemerer in their various papers on 'a metrics suite for object oriented design'.
</TR>
<TR>
<TH><H4><A HREF="#structsum">Structural Metrics Summary</A></H4></TH>
<TD>
Structural metrics based on the relationships of each module with others.  Includes fan-out (i.e. number of other modules the current module uses), fan-in (number of other modules which use the current module), and the Information Flow measure suggested by Henry and Kafura, which combines these to give a measure of coupling for the module.
</TR>
<TR>
<TH><H4><A HREF="#other">Other Extents</A></H4></TH>
<TD>
Lexical counts for parts of submitted source files which the analyser was unable to assign to a module. Each record in this table relates to either a part of the code which triggered a parse failure, or to the residual lexical counts relating to parts of a file not associated with a specific module.
</TR>
<TR>
<TH><H4><A HREF="#infocccc">About CCCC</A></H4></TH>
<TD>
A description of the CCCC program.
</TR>
</TR></TABLE>
<H1><A NAME="projsum">Project Summary</A></H1>
This table shows measures over the project as a whole.
<UL>
<LI>NOM = Number of modules<BR>
Number of non-trivial modules identified by the analyser.  Non-trivial modules include all classes, and any other module for which member functions are identified.
<LI>LOC = Lines of Code<BR>
Number of non-blank, non-comment lines of source code counted by the analyser.
<LI>COM = Lines of Comments<BR>
Number of lines of comment identified by the analyser
<LI>MVG = McCabe's Cyclomatic Complexity<BR>
A measure of the decision complexity of the functions which make up the program.The strict definition of this measure is that it is the number of linearly independent routes through a directed acyclic graph which maps the flow of control of a subprogram.  The analyser counts this by recording the number of distinct decision outcomes contained within each function, which yields a good approximation to the formally defined version of the measure.
<LI>L_C = Lines of code per line of comment<BR>
Indicates density of comments with respect to textual size of program
<LI>M_C = Cyclomatic Complexity per line of comment<BR>
Indicates density of comments with respect to logical complexity of program
<LI>IF4 = Information Flow measure<BR>
Measure of information flow between modules suggested by Henry and Kafura. The analyser makes an approximate count of this by counting inter-module couplings identified in the module interfaces.
</UL>
Two variants on the information flow measure IF4 are also presented, one (IF4v) calculated using only relationships in the visible part of the module interface, and the other (IF4c) calculated using only those relationships which imply that changes to the client must be recompiled of the supplier's definition changes.

<TABLE BORDER WIDTH=100%>
<TR>
<TH BGCOLOR="AQUA" WIDTH=70%>Metric</TH><TH BGCOLOR="AQUA" WIDTH=10%>Tag</TH><TH BGCOLOR="AQUA" WIDTH=10%>Overall</TH><TH BGCOLOR="AQUA" WIDTH=10%>Per Module</TH></TR>
<TR>
<TD>Number of modules</TD><TD>NOM</TD><TD ALIGN=RIGHT>    14</TD><TD>&nbsp;</TD></TR>
<TR>
<TD WIDTH=700%>Lines of Code</TD><TD WIDTH=120%>LOC</TD><TD ALIGN=RIGHT>   134</TD><TD ALIGN=RIGHT> 9.571</TD></TR>
<TR>
<TD>McCabe's Cyclomatic Number</TD><TD>MVG</TD><TD ALIGN=RIGHT>    16</TD><TD ALIGN=RIGHT> 1.143</TD></TR>
<TR>
<TD>Lines of Comment</TD><TD>COM</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT> 0.214</TD></TR>
<TR>
<TD>LOC/COM</TD><TD>L_C</TD><TD ALIGN=RIGHT BGCOLOR="RED"><STRONG>44.667</STRONG></TD><TD>&nbsp;</TD></TR>
<TR>
<TD>MVG/COM</TD><TD>M_C</TD><TD ALIGN=RIGHT BGCOLOR="YELLOW"><EM> 5.333</EM></TD><TD>&nbsp;</TD></TR>
<TR>
<TD>Information Flow measure ( &nbsp;inclusive&nbsp;)</TD><TD>IF4</TD><TD ALIGN=RIGHT>    72</TD><TD ALIGN=RIGHT>   5.143</TD></TR>
<TR>
<TD>Information Flow measure ( &nbsp;visible&nbsp;)</TD><TD>IF4v</TD><TD ALIGN=RIGHT>    72</TD><TD ALIGN=RIGHT>   5.143</TD></TR>
<TR>
<TD>Information Flow measure ( &nbsp;concrete&nbsp;)</TD><TD>IF4c</TD><TD ALIGN=RIGHT>    72</TD><TD ALIGN=RIGHT>   5.143</TD></TR>
<TR>
<TD>Lines of Code rejected by parser</TD><TD>REJ</TD><TD ALIGN=RIGHT>     5</TD><TD>&nbsp;</TD></TR>
</TABLE>
<H1><A NAME="procsum">Procedural Metrics Summary</A></H1>
For descriptions of each of these metrics see the information preceding the project summary table.

The label cell for each row in this table provides a link to the functions table in the detailed report for the module in question
<TABLE BORDER WIDTH=100%>
<TR>
<TH BGCOLOR="AQUA">Module Name</TH><TH BGCOLOR="AQUA" WIDTH=8%>LOC</TH><TH BGCOLOR="AQUA" WIDTH=8%>MVG</TH><TH BGCOLOR="AQUA" WIDTH=8%>COM</TH><TH BGCOLOR="AQUA" WIDTH=8%>L_C</TH><TH BGCOLOR="AQUA" WIDTH=8%>M_C</TH></TR>
<TR>
<TD><A HREF="AddOperator.html#procdet">
AddOperator</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="BinaryExpression.html#procdet">
BinaryExpression</A>
</TD><TD ALIGN=RIGHT>    20</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>******</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="BinaryOperator.html#procdet">
BinaryOperator</A>
</TD><TD ALIGN=RIGHT>    10</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="Const.html#procdet">
Const</A>
</TD><TD ALIGN=RIGHT>    16</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="Expression.html#procdet">
Expression</A>
</TD><TD ALIGN=RIGHT>     5</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="MulOperator.html#procdet">
MulOperator</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="Number.html#procdet">
Number</A>
</TD><TD ALIGN=RIGHT>    14</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="Operator.html#procdet">
Operator</A>
</TD><TD ALIGN=RIGHT>    16</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="SinusOperator.html#procdet">
SinusOperator</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="SubOperator.html#procdet">
SubOperator</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="UnaryExpression.html#procdet">
UnaryExpression</A>
</TD><TD ALIGN=RIGHT>    18</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="UnaryOperator.html#procdet">
UnaryOperator</A>
</TD><TD ALIGN=RIGHT>     7</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="anonymous.html#procdet">
anonymous</A>
</TD><TD ALIGN=RIGHT>     7</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
<TR>
<TD><A HREF="string.html#procdet">
string</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>------</TD><TD ALIGN=RIGHT>------</TD></TR>
</TABLE>
<H1><A NAME="oodesign">Object Oriented Design</A></H1>
<UL>
<LI>WMC = Weighted methods per class<BR>
The sum of a weighting function over the functions of the module.  Two different weighting functions are applied: WMC1 uses the nominal weight of 1 for each function, and hence measures the number of functions, WMCv uses a weighting function which is 1 for functions accessible to other modules, 0 for private functions.
<LI>DIT = Depth of inheritance tree<BR>
The length of the longest path of inheritance ending at the current module.  The deeper the inheritance tree for a module, the harder it may be to predict its behaviour.  On the other hand, increasing depth gives the potential of greater reuse by the current module of behaviour defined for ancestor classes.
<LI>NOC = Number of children<BR>
The number of modules which inherit directly from the current module.  Moderate values of this measure indicate scope for reuse, however high values may indicate an inappropriate abstraction in the design.
<LI>CBO = Coupling between objects<BR>
The number of other modules which are coupled to the current module either as a client or a supplier. Excessive coupling indicates weakness of module encapsulation and may inhibit reuse.
</UL>

The label cell for each row in this table provides a link to the module summary table in the detailed report for the module in question
<TABLE BORDER WIDTH=100%>
<TR>
<TH BGCOLOR="AQUA" WIDTH=50%>Module Name</TH><TH BGCOLOR="AQUA" WIDTH=10%>WMC1</TH><TH BGCOLOR="AQUA" WIDTH=10%>WMCv</TH><TH BGCOLOR="AQUA" WIDTH=10%>DIT</TH><TH BGCOLOR="AQUA" WIDTH=10%>NOC</TH><TH BGCOLOR="AQUA" WIDTH=10%>CBO</TH></TR>
<TR>
<TD><A HREF="AddOperator.html#summary">
AddOperator</A>
</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD></TR>
<TR>
<TD><A HREF="BinaryExpression.html#summary">
BinaryExpression</A>
</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD></TR>
<TR>
<TD><A HREF="BinaryOperator.html#summary">
BinaryOperator</A>
</TD><TD ALIGN=RIGHT>     5</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     6</TD></TR>
<TR>
<TD><A HREF="Const.html#summary">
Const</A>
</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD></TR>
<TR>
<TD><A HREF="Expression.html#summary">
Expression</A>
</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD></TR>
<TR>
<TD><A HREF="MulOperator.html#summary">
MulOperator</A>
</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD></TR>
<TR>
<TD><A HREF="Number.html#summary">
Number</A>
</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD></TR>
<TR>
<TD><A HREF="Operator.html#summary">
Operator</A>
</TD><TD ALIGN=RIGHT>     5</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     3</TD></TR>
<TR>
<TD><A HREF="SinusOperator.html#summary">
SinusOperator</A>
</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD></TR>
<TR>
<TD><A HREF="SubOperator.html#summary">
SubOperator</A>
</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD></TR>
<TR>
<TD><A HREF="UnaryExpression.html#summary">
UnaryExpression</A>
</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD></TR>
<TR>
<TD><A HREF="UnaryOperator.html#summary">
UnaryOperator</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     3</TD></TR>
<TR>
<TD><A HREF="anonymous.html#summary">
anonymous</A>
</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="string.html#summary">
string</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     3</TD></TR>
</TABLE>
<H1><A NAME="structsum">Structural Metrics Summary</A></H1>
<UL>
<LI>FI = Fan-in<BR>
The number of other modules which pass information into the current module.
<LI>FO = Fan-out<BR>
The number of other modules into which the current module passes information
<LI>IF4 = Information Flow measure<BR>
A composite measure of structural complexity, calculated as the square of the product of the fan-in and fan-out of a single module.  Proposed by Henry and Kafura.
</UL>
Note that the fan-in and fan-out are calculated by examining the interface of each module.  As noted above, three variants of each each of these measures are presented: a count restricted to the part of the interface which is externally visible, a count which only includes relationships which imply the client module needs to be recompiled if the supplier's implementation changes, and an inclusive count

The label cell for each row in this table provides a link to the relationships table in the detailed report for the module in question

<TABLE BORDER WIDTH=100%>
<TR>
<TH BGCOLOR=AQUA ROWSPAN=2>Module Name</TH>
<TH BGCOLOR=AQUA COLSPAN=3>Fan-out</TH>
<TH BGCOLOR=AQUA COLSPAN=3>Fan-in</TH>
<TH BGCOLOR=AQUA COLSPAN=3>IF4</TH>
</TR>
<TH BGCOLOR="AQUA" WIDTH=7%>vis</TH><TH BGCOLOR="AQUA" WIDTH=7%>con</TH><TH BGCOLOR="AQUA" WIDTH=7%>inc</TH><TH BGCOLOR="AQUA" WIDTH=7%>vis</TH><TH BGCOLOR="AQUA" WIDTH=7%>con</TH><TH BGCOLOR="AQUA" WIDTH=7%>incl</TH><TH BGCOLOR="AQUA" WIDTH=7%>vis</TH><TH BGCOLOR="AQUA" WIDTH=7%>con</TH><TH BGCOLOR="AQUA" WIDTH=7%>inc</TH></TR>
<TR>
<TD><A HREF="AddOperator.html#structdet">
AddOperator</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="BinaryExpression.html#structdet">
BinaryExpression</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="BinaryOperator.html#structdet">
BinaryOperator</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT BGCOLOR="YELLOW"><EM>    64</EM></TD><TD ALIGN=RIGHT BGCOLOR="YELLOW"><EM>    64</EM></TD><TD ALIGN=RIGHT>    64</TD></TR>
<TR>
<TD><A HREF="Const.html#structdet">
Const</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="Expression.html#structdet">
Expression</A>
</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="MulOperator.html#structdet">
MulOperator</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="Number.html#structdet">
Number</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="Operator.html#structdet">
Operator</A>
</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD></TR>
<TR>
<TD><A HREF="SinusOperator.html#structdet">
SinusOperator</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="SubOperator.html#structdet">
SubOperator</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="UnaryExpression.html#structdet">
UnaryExpression</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="UnaryOperator.html#structdet">
UnaryOperator</A>
</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     2</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD><TD ALIGN=RIGHT>     4</TD></TR>
<TR>
<TD><A HREF="anonymous.html#structdet">
anonymous</A>
</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR>
<TD><A HREF="string.html#structdet">
string</A>
</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     3</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
</TABLE>
<H1><A NAME="other">Other Extents</A></H1>
<TABLE BORDER WIDTH=100%>
<TR>
<TH BGCOLOR="AQUA" WIDTH=25%>Location</TH><TH BGCOLOR="AQUA" WIDTH=45%>Text</TH><TH BGCOLOR="AQUA" WIDTH=10%>LOC</TH><TH BGCOLOR="AQUA" WIDTH=10%>COM</TH><TH BGCOLOR="AQUA" WIDTH=10%>MVG</TH></TR>
<TR><TD><CODE><A HREF="cccc_src.html#expression.cpp:         1">expression.cpp:1</A></CODE><BR>
</TD>
<TD>&lt;file scope items&gt;</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR><TD><CODE><A HREF="cccc_src.html#expression.hpp:         1">expression.hpp:1</A></CODE><BR>
</TD>
<TD>&lt;file scope items&gt;</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR><TD><CODE><A HREF="cccc_src.html#main.cpp:         1">main.cpp:1</A></CODE><BR>
</TD>
<TD>&lt;file scope items&gt;</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR><TD><CODE><A HREF="cccc_src.html#operator.cpp:         1">operator.cpp:1</A></CODE><BR>
</TD>
<TD>&lt;file scope items&gt;</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
<TR><TD><CODE><A HREF="cccc_src.html#operator.hpp:         1">operator.hpp:1</A></CODE><BR>
</TD>
<TD>&lt;file scope items&gt;</TD><TD ALIGN=RIGHT>     1</TD><TD ALIGN=RIGHT>     0</TD><TD ALIGN=RIGHT>     0</TD></TR>
</TABLE>
<H1><A NAME="infocccc">About CCCC</A></H1>
<P>This report was generated by the program CCCC, which is FREELY REDISTRIBUTABLE but carries NO WARRANTY.
<P>CCCC was developed by Tim Littlefair. 
as part of a PhD research project. This project is now completed and descriptions of the findings can be accessed at <A HREF=http://www.chs.ecu.edu.au/~tlittlef>http://www.chs.ecu.edu.au/~tlittlef</A>. <P>User support for CCCC can be obtained by <A HREF=mailto:cccc-users@lists.sourceforge.net>mailing the list cccc-users@lists.sourceforge.net</A>.<P>Please also visit the CCCC development website at <A HREF=http://cccc.sourceforge.net>http://cccc.sourceforge.net</A>.
</BODY></HTML>

:::


# Dokładny opis interesujących metryk

## McCabe's Cyclomatic Number	

Złożoność cyklomatyczna w testowaniu oprogramowania jest metryką testowania używaną do pomiaru złożoności programu komputerowego. Jest to ilościowa miara niezależnych ścieżek w kodzie źródłowym programu komputerowego. 

Notacja grafu przepływu dla programu definiuje kilka węzłów połączonych krawędziami. Poniżej przedstawiono diagramy przepływu dla stwierdzeń typu if-else, While, until oraz normalnej sekwencji przepływu:
![](https://i.imgur.com/6jcQqZW.png)

Z matematycznego punktu widzenia jest to zbiór niezależnych ścieżek przechodzących przez diagram grafu. Złożoność kodową programu można określić za pomocą wzoru $V(G) = E - N + 2$,
gdzie,

$E$ - liczba krawędzi

$N$ - liczba węzłów

### Przytaczane są poniższe wartości złożoności cyklomatycznej:

- od 1 do 10 – kod dość prosty stwarzający nieznaczne ryzyko
- od 11 do 20 – kod złożony powodujący ryzyko na średnim poziomie
- od 21 do 50 – kod bardzo złożony związany z wysokim ryzykiem
- powyżej 50 – kod niestabilny grożący bardzo wysokim poziomem ryzyka.

Metryka ta jest użyteczna ze względu na właściwości złożoności cyklomatycznej ($M$).

### Użyteczność

$M$ może być liczbą przypadków testowych do osiągnięcia pokrycia gałęzi (górna granica)
$M$ może być liczbą ścieżek w grafie. (dolna granica)

## LOC/COM	

Liczba niepustych, nieopatrzonych komentarzem wierszy kodu źródłowego zliczonych przez analizator podzielona przez liczbę wierszy komentarza zidentyfikowanych przez analizator.

## Związane z projektowaniem obiektowym

### DIT - Depth of inheritance tree
Długość najdłuższej ścieżki dziedziczenia kończącej się w bieżącym module. Im głębsze drzewo dziedziczenia dla danego modułu, tym trudniejsze może być przewidzenie jego zachowania. Z drugiej strony, zwiększanie głębokości daje możliwość większego ponownego wykorzystania przez bieżący moduł zachowań zdefiniowanych dla klas przodków.

### CBO - Coupling between objects
Liczba innych modułów, które są sprzężone z bieżącym modułem jako klient lub dostawca. Nadmierne sprzężenie wskazuje na słabość hermetyzacji modułu i może uniemożliwić jego ponowne wykorzystanie.


## Podsumowanie metryk strukturalnych

**FI = Fan-In**
Liczba innych modułów, które przekazują informacje do bieżącego modułu.
**FO = Fan-out**
Liczba innych modułów, do których bieżący moduł przekazuje informacje.
**IF4 = Miara przepływu informacji**
Złożona miara złożoności strukturalnej, obliczana jako kwadrat iloczynów Fan-in i Fan-out pojedynczego modułu. 


# Co to jest Sonarqube?

SonarQube (dawniej Sonar) to platforma open-source opracowana przez SonarSource do ciągłej kontroli jakości kodu w celu wykonywania automatycznych przeglądów z analizą statyczną kodu w celu wykrycia błędów, zapachów kodu w ponad 20 językach programowania. SonarQube oferuje raporty na temat zduplikowanego kodu, standardów kodowania, testów jednostkowych, pokrycia kodu, złożoności kodu, komentarzy, błędów i zaleceń dotyczących bezpieczeństwa.

SonarQube obsługuje języki programowania Java (w tym Android), C#, C, C++, JavaScript, TypeScript, Python, Go, Swift, COBOL, Apex, PHP, Kotlin, Ruby, Scala, HTML, CSS, ABAP, Flex, Objective-C, PL/I, PL/SQL, RPG, T-SQL, VB.NET, VB6 i XML. 

![](https://i.imgur.com/WEJ2ctO.png)
![](https://i.imgur.com/Ns7AM2i.png)

Jednym ze sposobów patrzenia na Code smells jest odniesienie ich do zasad i jakości: "Code smells to pewne struktury w kodzie, które wskazują na naruszenie podstawowych zasad projektowania i negatywnie wpływają na jakość projektu". Code smells w kodzie zazwyczaj nie są błędami, nie są technicznie niepoprawne i nie uniemożliwiają działania programu. Wskazują raczej na słabości w projekcie, które mogą spowolnić rozwój lub zwiększyć ryzyko wystąpienia błędów lub awarii w przyszłości.

![](https://i.imgur.com/nlR86St.png)

Blocker (linter)

![](https://i.imgur.com/2ZoHG3F.png)
