Dependency Graph

Online documentation:

Dependency Matrix

Online documentation:

Visualizing Code Metrics through Treemaping

With the Online documentation, understand how Treemaping can help you see patterns in your code base, that would be hard to spot with other ways.

Abstractness versus Instability Diagram

The Abstractness versus Instability Diagram helps to detect which Projects are potentially painful to maintain (i.e concrete and stable) and which Projects are potentially useless (i.e abstract and instable).

Online documentation:

For beginners: Where to start

Code queries and rules results are truncated to list a maximum of 100 code elements in this report

Does this report gets too large?

The list contains only code elements refactored or added since the baseline for comparison.

The setting Recent Violations Only is enabled

Why should I enable the setting Recent Violations Only ?

Quick Tips

Main
Main \ Rules
Main \ Rules \ Project Rules
Main \ Rules \ Project Rules \ Code Quality
Main \ Rules \ Project Rules \ Object Oriented Design
Main \ Rules \ Project Rules \ Design
Main \ Rules \ Project Rules \ Architecture and Layering
Main \ Rules \ Project Rules \ CppCheck Queries
Main \ Rules \ Project Rules \ Diagnostics Queries
Main \ Rules \ Project Rules \ Dead Code
Main \ Rules \ Project Rules \ Visibility
Main \ Rules \ Project Rules \ Purity - Immutability - Constness
Main \ Rules \ Project Rules \ Naming Conventions
Main \ Rules \ Project Rules \ Source Files Organization
Main \ Group of Queries \ Object Oriented Design
Main \ Group of Queries \ API Breaking Changes
Main \ Group of Queries \ Code Diff Summary
Main \ Group of Queries \ Test and Code Coverage
Main \ Group of Queries \ Dead Code
Main \ Metrics \ Application Statistics
Main \ Metrics \ Projects Metrics
Main \ Metrics \ Namespaces Metrics
Main \ Metrics \ Types Metrics
Main \ Projects Dependencies
Main \ Namespaces Dependencies
Main \ Types Dependencies
Main \ Build Order
Main \ Analysis Log
Main \ Trend Charts
cppdepend report summary application nameCppcheck (v1.0.0.0)report build date07/13/2015 15:30:29analysis duration03:58cppdepend version 6.0.0.8890baseline for comparison Not Defined. To define a Baseline for Comparison, please read this online documentation.
Get started.Quick tips.Back to CppDepend. The present HTML report is a summary of data gathered by the analysis.
It is recommended to use the CppDepend interactive UI capabilities
to make the most of CppDepend by mastering all aspects of your code.

Diagrams

C/C++ Projects Dependency Graph
Dependency Graph
View as ?fullscaled
C/C++ Projects Dependency Matrix
Dependency Matrix
View as ?fullscaled
Treemap View
Treemap Metric View
View as ?fullscaled
Abstractness versus Instability
Abstractness vs. Instability
View as ?fullscaled

Application Metrics

Note: Further Application Statistics are available.
# Lines of Code
56 403      
0 (NotMyCode)
# Types
313      
3   Projects      
83   Namespaces      
5 400   Methods      
686   Fields      
160   Source Files      
Comment
19.85%      
13 971   Lines of Comment      
Method Complexity
375   Max      
3.41   Average      
Code Coverage by TestsN/A because no coverage data specified
Third-Party Usage
2   Projects used      
3   Namespaces used      
63   Types used      
384   Methods used      
36   Fields used      

Rules summary

45390This section lists all Rules violated, and Rules or Queries with Error
  • Number of Rules or Queries with Error (syntax error, exception thrown, time-out): 0
  • Number of Rules violated: 42

Summary of Rules violated

graphHelp Rules can be checked live at
development-time, from within Visual
Studio. Online documentation.
graphHelp CppDepend rules report too many flaws
on existing code base? Use the option
Recent Violations Only!
warningCritical Some Critical Rules are violated. Critical Rules
can be used to break the build process if
violated. Online documentation.
Name # Matches Elements Group
warningCritical   Types too big - critical
32 typesCode Quality
warningCritical   Methods too complex - critical
99 methodsCode Quality
warningCritical   Methods with too many parameters - critical
2 methodsCode Quality
warning   Quick summary of methods to refactor
520 methodsCode Quality
warning   Methods too big
396 methodsCode Quality
warning   Methods too complex
294 methodsCode Quality
warning   Methods potentially poorly commented
382 methodsCode Quality
warning   Methods with too many parameters
28 methodsCode Quality
warning   Methods with too many local variables
82 methodsCode Quality
warning   Types with too many methods
65 typesCode Quality
warning   Types with too many fields
2 typesCode Quality
warning   Types with poor cohesion
8 typesCode Quality
warning   Base class should not use derivatives
1 typesObject Oriented Design
warning   Constructor should not call a virtual methods
1 methodsObject Oriented Design
warning   Don't assign static fields from instance methods
3 fieldsObject Oriented Design
warning   Avoid Abstract Classes with too many methods
4 typesObject Oriented Design
warning   Nested types should not be visible
46 typesDesign
warning   Avoid namespaces mutually dependent
1 namespacesArchitecture and Layering
warning   Avoid namespaces dependency cycles
1 namespacesArchitecture and Layering
warning   Projects with poor cohesion (RelationalCohesion)
1 projectsArchitecture and Layering
warning   All CppCheck Violations
15 fieldsCppCheck Queries
warning   All diagnostics
1211 fieldsDiagnostics Queries
warning   Cast issues
293 fieldsDiagnostics Queries
warning   Conversion Issues
3 fieldsDiagnostics Queries
warning   Deprecated Usage
1 fieldsDiagnostics Queries
warning   Switch Issues
3 fieldsDiagnostics Queries
warning   Potentially dead Methods
3134 methodsDead Code
warning   Fields should be declared as private
399 fieldsVisibility
warning   Constructors of abstract classes should be declared as protected or private
6 typesVisibility
warning   Structures should be immutable
22 typesPurity - Immutability - Constness
warning   Avoid static fields with a mutable field type
9 fieldsPurity - Immutability - Constness
warning   Use const_cast carrefully
10 methodsPurity - Immutability - Constness
warning   Instance fields should be prefixed with a 'm_'
10 fieldsNaming Conventions
warning   Static fields should be prefixed with a 's_'
10 fieldsNaming Conventions
warning   Exception class name should be suffixed with 'Exception'
1 typesNaming Conventions
warning   Types name should begin with an Upper character
3 typesNaming Conventions
warning   Avoid methods with name too long
81 methodsNaming Conventions
warning   Namespace name should correspond to file location
81 typesNaming Conventions
warning   Avoid defining multiple types in a source file
16 typesSource Files Organization
warning   Namespace name should correspond to file location
2 typesSource Files Organization
warning   Types with source files stored in the same directory, should be declared in the same namespace
2 namespacesSource Files Organization
warning   Types declared in the same namespace, should have their source files stored in the same directory
3 namespacesSource Files Organization

Application Statistics

Stat # Occurences Avg StdDev Max
Public properties on classes 256 Classes 000 public properties on Keywords
Public methods on classes 256 classes 9.6417.86168 public methods on __Globals
Arguments on public methods on classes 2,469 methods 0.991.149 arguments on __Globals.valueFlowForward(Token*const,constToken*const,constVariable*const,constunsignedint,std::list<ValueFlow::Value>,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
Cyclomatic complexity on non abstract Methods 6,145 Methods 0.782.52 CC = 52 for Library.load(consttinyxml2::XMLDocument&)

Projects Metrics

If you wish to define thresholds on Projects' Code Metrics, consider writing some Rules.
Clicking column header arrows sorts values.
Clicking column header title text redirect to the online Code Metric definition.
Projects # lines of code # Types # Abstract Types # lines of comment% CommentAfferent CouplingEfferent CouplingRelational CohesionInstabilityAbstractnessDistance
cppcheck v1.0.0.029136179581912170595.070.460.030.36
cli v1.0.0.095980368270661.4100
testrunner v1.0.0.026308126054121701321.5510.010.01

Types Metrics : Code Quality

For a particular Code Metric defined for types, values in red represent the 15% highest values.
If you wish to define thresholds on types' Code Metrics, consider writing some Rule.
Clicking column header arrows sorts values.
Clicking column header title text redirect to the online Code Metric definition.
Type Name Type Rank# Lines Of Code# Lines Of Comment% CommentCyclomatic ComplexityAfferent CouplingEfferent Coupling Type Namespace
Token9.968584336429.7942333-8133
Settings7.9515933618.464113-9625
Tokenizer6.975727200155521.352375132-8362
TestFixture6.85103143.744610-5928
__Globals5.2118942913.36513-5236
__Globals5.19299613249414.151409182-3874
Scope3.79326168620.8716713-4136
ErrorLogger3.612133361.11206-4815
Variable3.36154319956.37942-3617
Library3.360811304.727796-4245
XMLDocument3.02207112938.396213-1519tinyxml2
XMLUtil2.9612932114560-102tinyxml2
Severity+SeverityType2.91--0-0--400
XMLError2.61--0-0--90tinyxml2
XMLNode2.57193614843.4931-1012tinyxml2
Check2.423512339.66244-3818
StrPair2.3311852819.18390-79tinyxml2
XMLVisitor2.25804384.31120-87tinyxml2
SymbolDatabase2.213112826116.650856-3445
StrPair+AnonymousEnum2.2--0-0--60tinyxml2
MemPoolT<SIZE>+Chunk1.93000-00-21tinyxml2
ErrorLogger+ErrorMessage1.917165223.325739-1831
InternalError1.879032570-186
XMLText1.863001736.17190-79tinyxml2
Type1.827641415.56384-1424
MathLib1.79449126212.1319556-1916
Check+FileInfo1.7800110030-70
XMLElement1.75231820647.141042-713tinyxml2
Function1.725495317.261445-2628
XMLUnknown1.661601140.74120-67tinyxml2
XMLDeclaration1.661601650120-67tinyxml2
TokenList1.6622299329.528513-2023
Path1.559329751.054745-1719
MemPool1.4500410090-50tinyxml2
Library+ErrorCode1.44--0-0--150
Scope+ScopeType1.31--0-0--170
Preprocessor1.314903840421.33576249-1252
Settings+PlatformType1.28--0-0--120
Token+Type1.28--0-0--170
AccessControl1.24--0-0--90
Library+Container+Action1.17--0-0--50
Library+Container+Yield1.17--0-0--50
ErrorLogger+ErrorMessage+FileLocation1.171701750134-1311
Suppressions1.167675742.865030-1424
XMLAttribute1.166603836.54340-56tinyxml2
XMLComment1.15160523.81120-47tinyxml2
Library+Error1.03600070-145
Library+ArgumentChecks+MinSize+Type1.02--0-0--30
VarInfo+AllocStatus0.89--0-0--20
Variables0.8712281913.486315-222
SHOWTIME_MODES0.84--0-0--70
__Globals0.78700030-34tinyxml2
Settings+Language0.77--0-0--60
Function+Type0.73--0-0--90
InternalError+Type0.72--0-0--20
options0.721101047.6290-29
Value0.721600040-74ValueFlow
Type+BaseInfo0.6850116.6770-75
Whitespace0.65--0-0--20tinyxml2
CppCheck0.63300915433.9210473-844
XMLElement+AnonymousEnum0.63--0-0--20tinyxml2
Suppressions+SuppressionEntry0.61300050-35
Entity0.58000-00-22tinyxml2
CheckMemoryLeak+AllocType0.58--0-0--70
Library+Container0.571200092-415
MemPoolT<SIZE>0.5540224.76150-26tinyxml2
RedirectOutputError0.531402058.8262-39
Dimension0.5240342.8660-43
Library+PodType0.5100110040-42
CheckMemoryLeak0.5121439931.6311728-629
Filepointer+AppendMode0.51--0-0--20
Filepointer+Operation0.51--0-0--20
OpenMode0.51--0-0--20
XMLAttribute+AnonymousEnum0.51--0-0--10tinyxml2
DynArray<T,INIT>0.534012.86190-21tinyxml2
StrPair+AnonymousEnum0.5--0-0--10tinyxml2
Variables+VariableType0.5--0-0--30
CheckClass0.4910656637425.99558141-348
Type+NeedInitialization0.48--0-0--60
TimerResultsData0.48400050-21
Library+PlatformType0.48800070-34
CheckMemoryLeakInFunction0.469951526320.9143526-533
TemplateSimplifier0.467533223623.8633953-336
CheckOther0.4613408637721.96678137-345
Library+ArgumentChecks0.46500050-53
Token+Anonymous0.44000-10-10
Token+AnonymousEnum0.44--0-0--10
XMLPrinter0.4316859335.63710-218tinyxml2
Scope+UsingInfo0.43000-60-32
MemPoolT<SIZE>+Block0.42000-00-11tinyxml2
MemPoolT<SIZE>+AnonymousEnum0.42--0-0--10tinyxml2
TestRegistry0.440342.8681-12
Variable+AnonymousEnum0.39--0-0--10
PathMatch0.362923151.672110-214
CheckStl0.357603520821.4936978-242
FileLister0.354604549.45187-412
XMLElement+AnonymousEnum0.35--0-0--10tinyxml2
Library+Container+Function0.35000-40-22
TimerResultsIntf0.34000-50-23
CheckNullPointer0.332571210729.414422-432
Library+ArgumentChecks+MinSize0.33300040-32
__Globals0.3317133617.395510-325
ExecutionPath0.3121458127.4610721-219
ThreadExecutor0.3110232318.4307-327
CheckUninitVar0.315681610315.3529037-344
Timer0.31800090-212
TimerResults0.318115.26117-220
CppCheckExecutor0.3211211635.478027-347
VarInfo+AllocInfo0.29200040-22
Type+FriendInfo0.28300060-33
CheckMemoryLeakInClass0.2811963422.226515-127
CheckBool0.28245195217.5113920-124
CheckExceptionSafety0.28137117033.827916-124
CheckAssert0.285341420.9418-116
Check64BitPortability0.286931921.59454-117
CheckVaarg0.287941616.844615-122
CheckSizeof0.28178124921.599624-119
CheckMemoryLeakStructMember0.2811353322.6654-119
CheckPostfixOperator0.282721230.77244-115
CheckType0.2712393220.658020-124
CheckNonReentrantFunctions0.273951527.782819-121
CheckLeakAutoVar0.2728876217.7113749-132
Variables+VariableUsage0.27110321.4380-26
Variables+ScopeGuard0.274012040-22
scopeStackEntryType0.2640233.3350-12anonymous_namespace{tokenize.cpp}
EnumValue0.2635125.41141-113
__Globals0.261410020-14ValueFlow
Space0.26200050-13
CheckObsoleteFunctions0.265351724.292626-122
CheckUnusedVar0.2639188718.219040-146
CheckUnusedFunctions0.2614533619.89789-130
givenACodeSampleToTokenize0.26700081-28
CmdLineParser0.26400211722.6314348-236
Preprocessor+HeaderTypes0.25--0-0--20
CheckString0.25163133919.319022-118
CheckBoost0.25263721.21234-113
CheckMemoryLeakNoVar0.256963936.114216-123
CheckAutoVariables0.2518084319.281017-118
Function+AnonymousEnum0.24--0-0--10
TestCppcheck+ErrorLogger20.24100080-16
Suppressions+FileMatcher0.246753232.32349-119
Severity0.2438012.56259-17
Library+Platform0.24200071-111
Library+ExportedFunctions0.24400090-16
Library+CodeBlock0.249000130-17
CheckIO0.24115914655.3154273-142
CheckCondition0.24404196313.4920846-133
CppCheckExecutor0.23211211635.478027-247
XMLPrinter+AnonymousEnum0.23--0-0--10tinyxml2
CheckBufferOverrun0.238423627124.35384110-145
__Globals0.22100010-12anonymous_namespace{timer.cpp}
FileLister0.214604549.45187-212
TestPreprocessor+OurPreprocessor0.21400033-16
SimpleSuppressor0.2500090-110
ThreadExecutor+MessageType0.2--0-0--10
ThreadExecutor+MessageType0.2--0-0--10
CheckUnusedFunctions+FunctionUsage0.2300060-13
PreprocessorMacro0.1914753318.336217-121
VarInfo0.1923228144-114
Settings+Rule0.1930457.1460-12
EraseCheckLoop0.185433035.71325-111
__Globals0.1812232077-124anonymous_namespace{checkother.cpp}
VarInfo0.182036040-12
CheckClass+Usage0.182025060-11
__Globals0.181500090-13anonymous_namespace{checkclass.cpp}
CheckIO+ArgumentInfo0.181896136.44744-119
Filepointer0.18500040-14
CheckUninitVar+Alloc0.18--0-0--10
CheckUninitVar+MyFileInfo0.1800110060-12
UninitVar0.184881716325.0424523-131
CheckBufferOverrun+MyFileInfo+ArrayUsage0.18000-60-13
CheckBufferOverrun+ArrayInfo0.183522036.36251-113
CheckBufferOverrun+MyFileInfo0.1800110060-12
CmdLineParser0.18400211722.6314348-136
ThreadExecutor0.1810232318.4307-127
PathMatch0.182923151.672110-114
__Globals0.15000-10-01anonymous_namespace{checkuninitvar.cpp}
TestAssert0.1548047.69155-010
__Globals0.15000-10-01anonymous_namespace{checkunusedvar.cpp}
__Globals0.15000-10-01anonymous_namespace{test64bit.cpp}
Test64BitPortability0.156001014.29195-010
__Globals0.15000-10-01anonymous_namespace{checkcondition.cpp}
__Globals0.15000-10-01anonymous_namespace{checkstring.cpp}
TestCppcheck0.15253619.351910-014
__Globals0.15000-10-01anonymous_namespace{checkexceptionsafety .cpp}
__Globals0.15000-10-01anonymous_namespace{checkstl.cpp}
__Globals0.15000-10-01anonymous_namespace{checktype.cpp}
__Globals0.15000-10-01anonymous_namespace{testassert.cpp}
TestErrorLogger0.152000146.544845-015
__Globals0.15000-10-01anonymous_namespace{checkbool.cpp}
AST_state0.153012550-03
__Globals0.15000-10-01anonymous_namespace{checkassert.cpp}
TestVaarg0.15550812.7175-010
__Globals0.15000-10-01anonymous_namespace{checkautovariables .cpp}
IMAGEHLP_SYMBOL64_EXT0.15000-30-02
__Globals0.15000-10-01anonymous_namespace{checkbufferoverrun .cpp}
__Globals0.15000-10-01anonymous_namespace{testcppcheck.cpp}
__Globals0.15000-10-01anonymous_namespace{checkboost.cpp}
IMAGEHLP_SYMBOL64_EXT0.15000-30-02
__Globals0.15000-10-01anonymous_namespace{checkvaarg.cpp}
TestClass0.151338032919.7429876-015
__Globals0.15000-10-01anonymous_namespace{testcharvar.cpp}
TestCharVar0.155901216.9295-010
__Globals0.15000-10-01anonymous_namespace{checknullpointer .cpp}
TestCmdlineParser0.156270456.719217-017
__Globals0.15000-10-01anonymous_namespace{testclass.cpp}
__Globals0.15000-10-01anonymous_namespace{testbufferoverrun .cpp}
__Globals0.15000-10-01anonymous_namespace{checknonreentrantfun ctions.cpp}
__Globals0.15000-10-01anonymous_namespace{testboost.cpp}
TestBufferOverrun0.15976023619.4728445-017
TestBoost0.15270618.18108-013
__Globals0.15000-10-01anonymous_namespace{checkleakautovar .cpp}
__Globals0.15000-10-04anonymous_namespace{checkmemoryleak.cpp}
__Globals0.15000-10-01anonymous_namespace{checksizeof.cpp}
TestBool0.152740217.12536-010
__Globals0.15000-10-01anonymous_namespace{testconstructors .cpp}
TestAutoVariables0.1526205216.56918-013
__Globals0.15000-10-01anonymous_namespace{checkio.cpp}
__Globals0.15000-10-01anonymous_namespace{testautovariables .cpp}
__Globals0.15000-10-01anonymous_namespace{checkpostfixoperator .cpp}
TestCondition0.1539107916.815618-015
__Globals0.15000-10-01anonymous_namespace{testcmdlineparser .cpp}
__Globals0.15000-10-01anonymous_namespace{checkobsolescentfunc tions.cpp}
TestConstructors0.15564015321.342456-010
__Globals0.15000-10-01anonymous_namespace{testcondition.cpp}
__Globals0.15000-10-01anonymous_namespace{testbool.cpp}
__Globals0.15000-10-01anonymous_namespace{testerrorlogger.cpp}
TestString0.1517002814.143216-013
__Globals0.15000-10-01anonymous_namespace{teststring.cpp}
__Globals0.15000-10-01anonymous_namespace{teststl.cpp}
XMLConstHandle0.15180418.18308-05tinyxml2
XMLHandle0.151807280308-05tinyxml2
__Globals0.15000-10-01anonymous_namespace{testsymboldatabase .cpp}
TestThreadExecutor0.1548259.432512-018
TestSymbolDatabase0.1515471118110.47399106-037
TestSuppressions0.1515033117.134137-022
__Globals0.15000-10-01anonymous_namespace{testsuppressions .cpp}
TestStl0.15627111615.6116714-015
__Globals0.15000-10-01anonymous_namespace{testsimplifytemplate .cpp}
TestSimplifyTokens0.151429020012.28360102-019
TestSimplifyTemplate0.15295111127.3413832-014
TestSamples0.15262310.341212-023
__Globals0.15000-10-01anonymous_namespace{testsamples.cpp}
TestSizeof0.152110135.8276-010
__Globals0.15000-10-01anonymous_namespace{testsizeof.cpp}
__Globals0.15000-10-01anonymous_namespace{testsimplifytypedef .cpp}
__Globals0.15000-10-01anonymous_namespace{testsimplifytokens .cpp}
TestSimplifyTypedef0.15817027224.9825235-014
__Globals0.15000-10-01anonymous_namespace{testthreadexecutor .cpp}
TestUnusedVar0.15920118917.0424811-012
__Globals0.15000-10-01anonymous_namespace{testunusedvar.cpp}
__Globals0.15000-10-01anonymous_namespace{testunusedprivfunc .cpp}
__Globals0.15000-10-01anonymous_namespace{testunusedfunctions .cpp}
TestUnusedPrivateFunction0.1512704023.95675-010
TestValueFlow0.15440412622.267018-019
__Globals0.15000-10-01anonymous_namespace{testvaarg.cpp}
__Globals0.15000-10-01anonymous_namespace{testvalueflow.cpp}
__Globals0.15000-10-01anonymous_namespace{testvarid.cpp}
TestVarID0.15539012518.8326253-015
TestUnusedFunctions0.1513311711.335211-012
__Globals0.15000-10-01anonymous_namespace{testtoken.cpp}
TestTokenizer0.153012782421.48793256-030
TestToken0.1556719254.22121157-018
TestTimer0.15600081-05
__Globals0.15000-10-01anonymous_namespace{testtimer.cpp}
TestUninitVar0.15984126421.158927-023
__Globals0.15000-10-01anonymous_namespace{testuninitvar.cpp}
__Globals0.15000-10-01anonymous_namespace{testtype.cpp}
__Globals0.15000-10-01anonymous_namespace{testtokenize.cpp}
TestType0.15390817.02147-011
__Globals0.15000-10-01anonymous_namespace{testlibrary.cpp}
TestMathLib0.15737011513.5587-010
TestLibrary0.152340135.263865-021
TestLeakAutoVar0.1529016618.541205-011
__Globals0.15000-10-01anonymous_namespace{testleakautovar.cpp}
TestMemleakInClass0.1518402712.8676-010
TestMemleakStructMember0.1514103821.23474-010
TestMemleakInFunction0.151073419515.3833533-021
__Globals0.15000-10-01anonymous_namespace{testmathlib.cpp}
TestMemleak0.15260413.33118-015
__Globals0.15000-10-01anonymous_namespace{testio.cpp}
TestFileLister0.15201520135-016
__Globals0.15000-10-01anonymous_namespace{testfilelister.cpp}
__Globals0.15000-10-01anonymous_namespace{testexceptionsafety .cpp}
__Globals0.15000-10-01anonymous_namespace{check64bit.cpp}
TestExceptionSafety0.159601110.28415-010
__Globals0.15000-10-01anonymous_namespace{testincompletestatem ent.cpp}
TestIO0.1563407210.25136-015
TestIncompleteStatement0.157801919.59435-010
TestGarbage0.1518517929.9210460-017
__Globals0.15000-10-01anonymous_namespace{testgarbage.cpp}
TestMemleakNoVar0.158711514.71154-013
__Globals0.15000-10-01anonymous_namespace{testpath.cpp}
TestPathMatch0.1578044.886012-07
TestPath0.1589077.29181-07
TestOther0.151555023413.0822877-024
__Globals0.15000-10-01anonymous_namespace{testother.cpp}
TestPreprocessor0.151770133115.75375703-021
__Globals0.15000-10-01anonymous_namespace{testpreprocessor .cpp}
__Globals0.15000-10-01anonymous_namespace{testpostfixoperator .cpp}
__Globals0.15000-10-01anonymous_namespace{testpathmatch.cpp}
TestPostfixOperator0.1575078.54275-010
__Globals0.15000-10-01anonymous_namespace{testoptions.cpp}
TestNonReentrantFunctions0.15320921.95115-011
__Globals0.15000-10-01anonymous_namespace{testnonreentrantfunc tions.cpp}
TestMemleakWindows0.15180418.18106-018
__Globals0.15000-10-01anonymous_namespace{testmemleak.cpp}
TestMemleakGLib0.15160420106-018
__Globals0.15000-10-01anonymous_namespace{testobsolescentfunct ions.cpp}
TestOptions0.1534000228-04
TestObsoleteFunctions0.157701617.2395-012
TestNullPointer0.15660018621.9910327-018
__Globals0.15000-10-01anonymous_namespace{testnullpointer.cpp}

Types Metrics : Code Members and Inheritance

Type Name # Instance Methods Nb Static Methods # Fields# Children ClassesDepth Of Inheritance Tree Type Namespace
Token1222101700
Settings17005100
Tokenizer144110900
TestFixture241112581
__Globals31101900
__Globals516302000
Scope27001800
ErrorLogger9120660
Variable4800900
Library52302700
XMLDocument36001201tinyxml2
XMLUtil0200000tinyxml2
Severity+SeverityType------
XMLError------tinyxml2
XMLNode5013860tinyxml2
Check17234280
StrPair1400300tinyxml2
XMLVisitor1200010tinyxml2
SymbolDatabase2610900
StrPair+AnonymousEnum------tinyxml2
MemPoolT<SIZE>+Chunk00-2--tinyxml2
ErrorLogger+ErrorMessage1530800
InternalError5003--
XMLText1200101tinyxml2
Type1000600
MathLib6320000
Check+FileInfo300020
XMLElement5310201tinyxml2
Function54101500
XMLUnknown1000001tinyxml2
XMLDeclaration1000001tinyxml2
TokenList2220600
Path6150000
MemPool905010tinyxml2
Library+ErrorCode------
Scope+ScopeType------
Preprocessor23130610
Settings+PlatformType------
Token+Type------
AccessControl------
Library+Container+Action------
Library+Container+Yield------
ErrorLogger+ErrorMessage+FileLocation1100200
Suppressions1300100
XMLAttribute2500400tinyxml2
XMLComment1000001tinyxml2
Library+Error700200
Library+ArgumentChecks+MinSize+Type------
VarInfo+AllocStatus------
Variables2600300
SHOWTIME_MODES------
__Globals110200tinyxml2
Settings+Language------
Function+Type------
InternalError+Type------
options800400
Value400800ValueFlow
Type+BaseInfo700500
Whitespace------tinyxml2
CppCheck2530901
XMLElement+AnonymousEnum------tinyxml2
Suppressions+SuppressionEntry5003--
Entity0003--tinyxml2
CheckMemoryLeak+AllocType------
Library+Container700700
MemPoolT<SIZE>1000601tinyxml2
RedirectOutputError600400
Dimension6004--
Library+PodType4002--
CheckMemoryLeak2110340
Filepointer+AppendMode------
Filepointer+Operation------
OpenMode------
XMLAttribute+AnonymousEnum------tinyxml2
DynArray<T,INIT>1600400tinyxml2
StrPair+AnonymousEnum------tinyxml2
Variables+VariableType------
CheckClass6590101
Type+NeedInitialization------
TimerResultsData5002--
Library+PlatformType7007--
CheckMemoryLeakInFunction1640101
TemplateSimplifier4160000
CheckOther10420001
Library+ArgumentChecks500700
Token+Anonymous10-2--
Token+AnonymousEnum------
XMLPrinter37001101tinyxml2
Scope+UsingInfo6002--
MemPoolT<SIZE>+Block0001--tinyxml2
MemPoolT<SIZE>+AnonymousEnum------tinyxml2
TestRegistry710100
Variable+AnonymousEnum------
PathMatch610200
CheckStl5310001
FileLister050000
XMLElement+AnonymousEnum------tinyxml2
Library+Container+Function4002--
TimerResultsIntf501010
CheckNullPointer1830001
Library+ArgumentChecks+MinSize400300
__Globals31001100
ExecutionPath1233320
ThreadExecutor10201401
CheckUninitVar2920101
Timer500500
TimerResults800101
CppCheckExecutor1340601
VarInfo+AllocInfo4002--
Type+FriendInfo6004--
CheckMemoryLeakInClass1510001
CheckBool3210001
CheckExceptionSafety2210001
CheckAssert1420001
Check64BitPortability1610001
CheckVaarg1710001
CheckSizeof2910001
CheckMemoryLeakStructMember1220001
CheckPostfixOperator1210001
CheckType1820001
CheckNonReentrantFunctions1210101
CheckLeakAutoVar2210001
Variables+VariableUsage700900
Variables+ScopeGuard400200
scopeStackEntryType5002--anonymous_namespace{tokenize.cpp}
EnumValue600400
__Globals100000ValueFlow
Space5003--
CheckObsoleteFunctions1210301
CheckUnusedVar2210201
CheckUnusedFunctions1420201
givenACodeSampleToTokenize500200
CmdLineParser1220700
Preprocessor+HeaderTypes------
CheckString2410001
CheckBoost1210001
CheckMemoryLeakNoVar1610001
CheckAutoVariables2560001
Function+AnonymousEnum------
TestCppcheck+ErrorLogger2800101
Suppressions+FileMatcher910200
Severity620000
Library+Platform6001--
Library+ExportedFunctions900200
Library+CodeBlock1300400
CheckIO3720001
CheckCondition3010001
CppCheckExecutor1340601
XMLPrinter+AnonymousEnum------tinyxml2
CheckBufferOverrun4430001
__Globals100000anonymous_namespace{timer.cpp}
FileLister050000
TestPreprocessor+OurPreprocessor030001
SimpleSuppressor800201
ThreadExecutor+MessageType------
ThreadExecutor+MessageType------
CheckUnusedFunctions+FunctionUsage600400
PreprocessorMacro1100800
VarInfo1100400
Settings+Rule600500
EraseCheckLoop1110201
__Globals300100anonymous_namespace{checkother.cpp}
VarInfo4002--
CheckClass+Usage6002--
__Globals300100anonymous_namespace{checkclass.cpp}
CheckIO+ArgumentInfo1000700
Filepointer4005--
CheckUninitVar+Alloc------
CheckUninitVar+MyFileInfo600201
UninitVar12150701
CheckBufferOverrun+MyFileInfo+ArrayUsage6003--
CheckBufferOverrun+ArrayInfo1700400
CheckBufferOverrun+MyFileInfo600201
CmdLineParser1220700
ThreadExecutor10201401
PathMatch610200
__Globals100100anonymous_namespace{checkuninitvar.cpp}
TestAssert1200002
__Globals100100anonymous_namespace{checkunusedvar.cpp}
__Globals100100anonymous_namespace{test64bit.cpp}
Test64BitPortability1400002
__Globals100100anonymous_namespace{checkcondition.cpp}
__Globals100100anonymous_namespace{checkstring.cpp}
TestCppcheck1000002
__Globals100100anonymous_namespace{checkexceptionsafety .cpp}
__Globals100100anonymous_namespace{checkstl.cpp}
__Globals100100anonymous_namespace{checktype.cpp}
__Globals100100anonymous_namespace{testassert.cpp}
TestErrorLogger2800202
__Globals100100anonymous_namespace{checkbool.cpp}
AST_state5004--
__Globals100100anonymous_namespace{checkassert.cpp}
TestVaarg1300002
__Globals100100anonymous_namespace{checkautovariables .cpp}
IMAGEHLP_SYMBOL64_EXT3001--
__Globals100100anonymous_namespace{checkbufferoverrun .cpp}
__Globals100100anonymous_namespace{testcppcheck.cpp}
__Globals100100anonymous_namespace{checkboost.cpp}
IMAGEHLP_SYMBOL64_EXT3001--
__Globals100100anonymous_namespace{checkvaarg.cpp}
TestClass15900002
__Globals100100anonymous_namespace{testcharvar.cpp}
TestCharVar1900002
__Globals100100anonymous_namespace{checknullpointer .cpp}
TestCmdlineParser10300202
__Globals100100anonymous_namespace{testclass.cpp}
__Globals100100anonymous_namespace{testbufferoverrun .cpp}
__Globals100100anonymous_namespace{checknonreentrantfun ctions.cpp}
__Globals100100anonymous_namespace{testboost.cpp}
TestBufferOverrun14700002
TestBoost900002
__Globals100100anonymous_namespace{checkleakautovar .cpp}
__Globals100400anonymous_namespace{checkmemoryleak.cpp}
__Globals100100anonymous_namespace{checksizeof.cpp}
TestBool3100002
__Globals100100anonymous_namespace{testconstructors .cpp}
TestAutoVariables4900002
__Globals100100anonymous_namespace{checkio.cpp}
__Globals100100anonymous_namespace{testautovariables .cpp}
__Globals100100anonymous_namespace{checkpostfixoperator .cpp}
TestCondition3200002
__Globals100100anonymous_namespace{testcmdlineparser .cpp}
__Globals100100anonymous_namespace{checkobsolescentfunc tions.cpp}
TestConstructors12700002
__Globals100100anonymous_namespace{testcondition.cpp}
__Globals100100anonymous_namespace{testbool.cpp}
__Globals100100anonymous_namespace{testerrorlogger.cpp}
TestString2100002
__Globals100100anonymous_namespace{teststring.cpp}
__Globals100100anonymous_namespace{teststl.cpp}
XMLConstHandle1800100tinyxml2
XMLHandle1800100tinyxml2
__Globals100100anonymous_namespace{testsymboldatabase .cpp}
TestThreadExecutor1500002
TestSymbolDatabase15220602
TestSuppressions2300002
__Globals100100anonymous_namespace{testsuppressions .cpp}
TestStl8800102
__Globals100100anonymous_namespace{testsimplifytemplate .cpp}
TestSimplifyTokens18500202
TestSimplifyTemplate7400002
TestSamples800002
__Globals100100anonymous_namespace{testsamples.cpp}
TestSizeof1800002
__Globals100100anonymous_namespace{testsizeof.cpp}
__Globals100100anonymous_namespace{testsimplifytypedef .cpp}
__Globals100100anonymous_namespace{testsimplifytokens .cpp}
TestSimplifyTypedef13100002
__Globals100100anonymous_namespace{testthreadexecutor .cpp}
TestUnusedVar12800002
__Globals100100anonymous_namespace{testunusedvar.cpp}
__Globals100100anonymous_namespace{testunusedprivfunc .cpp}
__Globals100100anonymous_namespace{testunusedfunctions .cpp}
TestUnusedPrivateFunction3800002
TestValueFlow3600002
__Globals100100anonymous_namespace{testvaarg.cpp}
__Globals100100anonymous_namespace{testvalueflow.cpp}
__Globals100100anonymous_namespace{testvarid.cpp}
TestVarID13500002
TestUnusedFunctions3000002
__Globals100100anonymous_namespace{testtoken.cpp}
TestTokenizer38910102
TestToken5410602
TestTimer800002
__Globals100100anonymous_namespace{testtimer.cpp}
TestUninitVar4900102
__Globals100100anonymous_namespace{testuninitvar.cpp}
__Globals100100anonymous_namespace{testtype.cpp}
__Globals100100anonymous_namespace{testtokenize.cpp}
TestType1100002
__Globals100100anonymous_namespace{testlibrary.cpp}
TestMathLib3300002
TestLibrary2200002
TestLeakAutoVar6300002
__Globals100100anonymous_namespace{testleakautovar.cpp}
TestMemleakInClass3800002
TestMemleakStructMember2700002
TestMemleakInFunction16610202
__Globals100100anonymous_namespace{testmathlib.cpp}
TestMemleak1000002
__Globals100100anonymous_namespace{testio.cpp}
TestFileLister900002
__Globals100100anonymous_namespace{testfilelister.cpp}
__Globals100100anonymous_namespace{testexceptionsafety .cpp}
__Globals100100anonymous_namespace{check64bit.cpp}
TestExceptionSafety2500002
__Globals100100anonymous_namespace{testincompletestatem ent.cpp}
TestIO2900102
TestIncompleteStatement2600002
TestGarbage5500002
__Globals100100anonymous_namespace{testgarbage.cpp}
TestMemleakNoVar1100102
__Globals100100anonymous_namespace{testpath.cpp}
TestPathMatch3400402
TestPath1300002
TestOther12000002
__Globals100100anonymous_namespace{testother.cpp}
TestPreprocessor19200002
__Globals100100anonymous_namespace{testpreprocessor .cpp}
__Globals100100anonymous_namespace{testpostfixoperator .cpp}
__Globals100100anonymous_namespace{testpathmatch.cpp}
TestPostfixOperator1800002
__Globals100100anonymous_namespace{testoptions.cpp}
TestNonReentrantFunctions1000002
__Globals100100anonymous_namespace{testnonreentrantfunc tions.cpp}
TestMemleakWindows900102
__Globals100100anonymous_namespace{testmemleak.cpp}
TestMemleakGLib900102
__Globals100100anonymous_namespace{testobsolescentfunct ions.cpp}
TestOptions1500002
TestObsoleteFunctions2400002
TestNullPointer5500102
__Globals100100anonymous_namespace{testnullpointer.cpp}

Types Metrics : Lack Of Cohesion Of Methods and Association Between Classes

Type Name Lack Of Cohesion Of MethodsLack Of Cohesion Of Methods HSAssociation Between Classes Type Namespace
Token0.940.95132
Settings0.921.0146
Tokenizer0.870.87369
TestFixture0.860.966
__Globals11.0879
__Globals00400
Scope0.860.9109
ErrorLogger0025
Variable0.890.9256
Library0.950.97181
XMLDocument0.880.9153tinyxml2
XMLUtil0013tinyxml2
Severity+SeverityType--0
XMLError--0tinyxml2
XMLNode0.860.8820tinyxml2
Check0.830.8824
StrPair0.480.5121tinyxml2
XMLVisitor000tinyxml2
SymbolDatabase0.860.89302
StrPair+AnonymousEnum--0tinyxml2
MemPoolT<SIZE>+Chunk000tinyxml2
ErrorLogger+ErrorMessage0.570.6185
InternalError004
XMLText0.750.8220tinyxml2
Type0.70.8841
MathLib0045
Check+FileInfo000
XMLElement0.890.9171tinyxml2
Function0.950.9796
XMLUnknown0013tinyxml2
XMLDeclaration0013tinyxml2
TokenList0.790.8388
Path0058
MemPool000tinyxml2
Library+ErrorCode--0
Scope+ScopeType--0
Preprocessor0.720.74261
Settings+PlatformType--0
Token+Type--0
AccessControl--0
Library+Container+Action--0
Library+Container+Yield--0
ErrorLogger+ErrorMessage+FileLocation0.250.314
Suppressions0.290.3356
XMLAttribute0.860.920tinyxml2
XMLComment0013tinyxml2
Library+Error003
Library+ArgumentChecks+MinSize+Type--0
VarInfo+AllocStatus--0
Variables0.780.8244
SHOWTIME_MODES--0
__Globals003tinyxml2
Settings+Language--0
Function+Type--0
InternalError+Type--0
options0.750.888
Value000ValueFlow
Type+BaseInfo0.511
Whitespace--0tinyxml2
CppCheck0.810.84154
XMLElement+AnonymousEnum--0tinyxml2
Suppressions+SuppressionEntry001
Entity000tinyxml2
CheckMemoryLeak+AllocType--0
Library+Container0.711.079
MemPoolT<SIZE>0.570.633tinyxml2
RedirectOutputError0.50.613
Dimension000
Library+PodType000
CheckMemoryLeak0.810.8580
Filepointer+AppendMode--0
Filepointer+Operation--0
OpenMode--0
XMLAttribute+AnonymousEnum--0tinyxml2
DynArray<T,INIT>0.580.620tinyxml2
StrPair+AnonymousEnum--0tinyxml2
Variables+VariableType--0
CheckClass0.740.75234
Type+NeedInitialization--0
TimerResultsData0.250.51
Library+PlatformType0.380.571
CheckMemoryLeakInFunction0.730.79144
TemplateSimplifier00148
CheckOther00221
Library+ArgumentChecks0.2900
Token+Anonymous000
Token+AnonymousEnum--0
XMLPrinter0.870.939tinyxml2
Scope+UsingInfo000
MemPoolT<SIZE>+Block000tinyxml2
MemPoolT<SIZE>+AnonymousEnum--0tinyxml2
TestRegistry0.330.52
Variable+AnonymousEnum--0
PathMatch0.330.528
CheckStl00154
FileLister0033
XMLElement+AnonymousEnum--0tinyxml2
Library+Container+Function000
TimerResultsIntf000
CheckNullPointer0094
Library+ArgumentChecks+MinSize000
__Globals0060
ExecutionPath0.740.7939
ThreadExecutor0.790.8666
CheckUninitVar0.920.96136
Timer0.50.6712
TimerResults0.330.531
CppCheckExecutor0.810.87154
VarInfo+AllocInfo001
Type+FriendInfo0.2500
CheckMemoryLeakInClass0076
CheckBool0070
CheckExceptionSafety0067
CheckAssert0044
Check64BitPortability0034
CheckVaarg0054
CheckSizeof0057
CheckMemoryLeakStructMember0045
CheckPostfixOperator0029
CheckType0067
CheckNonReentrantFunctions0.50.5744
CheckLeakAutoVar00110
Variables+VariableUsage0.560.835
Variables+ScopeGuard0.330.52
scopeStackEntryType000anonymous_namespace{tokenize.cpp}
EnumValue0.250.3113
__Globals0016ValueFlow
Space0.3300
CheckObsoleteFunctions0.670.7649
CheckUnusedVar0.941158
CheckUnusedFunctions0.820.994
givenACodeSampleToTokenize0.250.57
CmdLineParser0.740.83124
Preprocessor+HeaderTypes--0
CheckString0061
CheckBoost0024
CheckMemoryLeakNoVar0058
CheckAutoVariables0065
Function+AnonymousEnum--0
TestCppcheck+ErrorLogger20.514
Suppressions+FileMatcher0.50.6730
Severity0015
Library+Platform005
Library+ExportedFunctions0.50.674
Library+CodeBlock0.750.845
CheckIO00170
CheckCondition00122
CppCheckExecutor0.810.87154
XMLPrinter+AnonymousEnum--0tinyxml2
CheckBufferOverrun00217
__Globals002anonymous_namespace{timer.cpp}
FileLister0033
TestPreprocessor+OurPreprocessor007
SimpleSuppressor0.170.2513
ThreadExecutor+MessageType--0
ThreadExecutor+MessageType--0
CheckUnusedFunctions+FunctionUsage0.2500
PreprocessorMacro0.760.8663
VarInfo0.250.3125
Settings+Rule0.401
EraseCheckLoop0.570.6735
__Globals11.527anonymous_namespace{checkother.cpp}
VarInfo000
CheckClass+Usage000
__Globals11.59anonymous_namespace{checkclass.cpp}
CheckIO+ArgumentInfo0.670.7556
Filepointer003
CheckUninitVar+Alloc--0
CheckUninitVar+MyFileInfo002
UninitVar0.760.884
CheckBufferOverrun+MyFileInfo+ArrayUsage000
CheckBufferOverrun+ArrayInfo0.540.5919
CheckBufferOverrun+MyFileInfo002
CmdLineParser0.740.83124
ThreadExecutor0.790.8666
PathMatch0.330.528
__Globals101anonymous_namespace{checkuninitvar.cpp}
TestAssert0018
__Globals101anonymous_namespace{checkunusedvar.cpp}
__Globals101anonymous_namespace{test64bit.cpp}
Test64BitPortability0019
__Globals101anonymous_namespace{checkcondition.cpp}
__Globals101anonymous_namespace{checkstring.cpp}
TestCppcheck0034
__Globals101anonymous_namespace{checkexceptionsafety .cpp}
__Globals101anonymous_namespace{checkstl.cpp}
__Globals101anonymous_namespace{checktype.cpp}
__Globals101anonymous_namespace{testassert.cpp}
TestErrorLogger0.520.5547
__Globals101anonymous_namespace{checkbool.cpp}
AST_state0.2500
__Globals101anonymous_namespace{checkassert.cpp}
TestVaarg0018
__Globals001anonymous_namespace{checkautovariables .cpp}
IMAGEHLP_SYMBOL64_EXT001
__Globals101anonymous_namespace{checkbufferoverrun .cpp}
__Globals101anonymous_namespace{testcppcheck.cpp}
__Globals101anonymous_namespace{checkboost.cpp}
IMAGEHLP_SYMBOL64_EXT001
__Globals101anonymous_namespace{checkvaarg.cpp}
TestClass0045
__Globals101anonymous_namespace{testcharvar.cpp}
TestCharVar0018
__Globals101anonymous_namespace{checknullpointer .cpp}
TestCmdlineParser0.180.1979
__Globals101anonymous_namespace{testclass.cpp}
__Globals101anonymous_namespace{testbufferoverrun .cpp}
__Globals101anonymous_namespace{checknonreentrantfun ctions.cpp}
__Globals101anonymous_namespace{testboost.cpp}
TestBufferOverrun0051
TestBoost0024
__Globals101anonymous_namespace{checkleakautovar .cpp}
__Globals104anonymous_namespace{checkmemoryleak.cpp}
__Globals101anonymous_namespace{checksizeof.cpp}
TestBool0023
__Globals101anonymous_namespace{testconstructors .cpp}
TestAutoVariables0029
__Globals101anonymous_namespace{checkio.cpp}
__Globals101anonymous_namespace{testautovariables .cpp}
__Globals101anonymous_namespace{checkpostfixoperator .cpp}
TestCondition0031
__Globals101anonymous_namespace{testcmdlineparser .cpp}
__Globals101anonymous_namespace{checkobsolescentfunc tions.cpp}
TestConstructors0021
__Globals101anonymous_namespace{testcondition.cpp}
__Globals101anonymous_namespace{testbool.cpp}
__Globals101anonymous_namespace{testerrorlogger.cpp}
TestString0030
__Globals101anonymous_namespace{teststring.cpp}
__Globals101anonymous_namespace{teststl.cpp}
XMLConstHandle0012tinyxml2
XMLHandle0012tinyxml2
__Globals101anonymous_namespace{testsymboldatabase .cpp}
TestThreadExecutor0028
TestSymbolDatabase0.780.78172
TestSuppressions0057
__Globals101anonymous_namespace{testsuppressions .cpp}
TestStl0.980.9929
__Globals101anonymous_namespace{testsimplifytemplate .cpp}
TestSimplifyTokens0.990.9954
TestSimplifyTemplate0032
TestSamples0039
__Globals101anonymous_namespace{testsamples.cpp}
TestSizeof0020
__Globals101anonymous_namespace{testsizeof.cpp}
__Globals101anonymous_namespace{testsimplifytypedef .cpp}
__Globals101anonymous_namespace{testsimplifytokens .cpp}
TestSimplifyTypedef0033
__Globals101anonymous_namespace{testthreadexecutor .cpp}
TestUnusedVar0025
__Globals101anonymous_namespace{testunusedvar.cpp}
__Globals101anonymous_namespace{testunusedprivfunc .cpp}
__Globals101anonymous_namespace{testunusedfunctions .cpp}
TestUnusedPrivateFunction0020
TestValueFlow0048
__Globals101anonymous_namespace{testvaarg.cpp}
__Globals101anonymous_namespace{testvalueflow.cpp}
__Globals101anonymous_namespace{testvarid.cpp}
TestVarID0027
TestUnusedFunctions0024
__Globals101anonymous_namespace{testtoken.cpp}
TestTokenizer0.991123
TestToken0.830.8484
TestTimer0011
__Globals101anonymous_namespace{testtimer.cpp}
TestUninitVar0.860.8847
__Globals101anonymous_namespace{testuninitvar.cpp}
__Globals101anonymous_namespace{testtype.cpp}
__Globals101anonymous_namespace{testtokenize.cpp}
TestType0021
__Globals101anonymous_namespace{testlibrary.cpp}
TestMathLib0046
TestLibrary0081
TestLeakAutoVar0026
__Globals101anonymous_namespace{testleakautovar.cpp}
TestMemleakInClass0020
TestMemleakStructMember0019
TestMemleakInFunction0.980.9970
__Globals101anonymous_namespace{testmathlib.cpp}
TestMemleak0027
__Globals101anonymous_namespace{testio.cpp}
TestFileLister0026
__Globals101anonymous_namespace{testfilelister.cpp}
__Globals101anonymous_namespace{testexceptionsafety .cpp}
__Globals101anonymous_namespace{check64bit.cpp}
TestExceptionSafety0020
__Globals101anonymous_namespace{testincompletestatem ent.cpp}
TestIO0.920.9635
TestIncompleteStatement0019
TestGarbage0039
__Globals101anonymous_namespace{testgarbage.cpp}
TestMemleakNoVar0.670.826
__Globals101anonymous_namespace{testpath.cpp}
TestPathMatch0.780.8111
TestPath0017
TestOther0063
__Globals101anonymous_namespace{testother.cpp}
TestPreprocessor0092
__Globals101anonymous_namespace{testpreprocessor .cpp}
__Globals101anonymous_namespace{testpostfixoperator .cpp}
__Globals101anonymous_namespace{testpathmatch.cpp}
TestPostfixOperator0020
__Globals101anonymous_namespace{testoptions.cpp}
TestNonReentrantFunctions0021
__Globals101anonymous_namespace{testnonreentrantfunc tions.cpp}
TestMemleakWindows0.50.6728
__Globals101anonymous_namespace{testmemleak.cpp}
TestMemleakGLib0.50.6727
__Globals101anonymous_namespace{testobsolescentfunct ions.cpp}
TestOptions0011
TestObsoleteFunctions0023
TestNullPointer0.960.9849
__Globals101anonymous_namespace{testnullpointer.cpp}

Namespaces Metrics

If you wish to define thresholds on namespaces' Code Metrics, consider writing some Rules.
Clicking column header arrows sorts values.
Clicking column header title text redirect to the online Code Metric definition.
Namespaces # lines of code # Types # lines of comment% CommentAfferent CouplingEfferent Coupling
cppcheck::GlobalNamespace2775912100299
cppcheck::tinyxml21315300023
cppcheck::ValueFlow3020023
cppcheck::anonymous_namespace{check64bit .cpp}010001
cppcheck::anonymous_namespace{checkasser t.cpp}010001
cppcheck::anonymous_namespace{checkautov ariables.cpp}010001
cppcheck::anonymous_namespace{checkbool .cpp}010001
cppcheck::anonymous_namespace{checkboost .cpp}010001
cppcheck::anonymous_namespace{checkbuffe roverrun.cpp}010001
cppcheck::anonymous_namespace{checkclass .cpp}1510011
cppcheck::anonymous_namespace{checkcondi tion.cpp}010001
cppcheck::anonymous_namespace{checkstrin g.cpp}010001
cppcheck::anonymous_namespace{checkexcep tionsafety.cpp}010001
cppcheck::anonymous_namespace{checkio .cpp}010001
cppcheck::anonymous_namespace{checkleaka utovar.cpp}010001
cppcheck::anonymous_namespace{checkmemor yleak.cpp}010001
cppcheck::anonymous_namespace{checknonre entrantfunctions.cpp}010001
cppcheck::anonymous_namespace{checknullp ointer.cpp}010001
cppcheck::anonymous_namespace{checkobsol escentfunctions.cpp}010001
cppcheck::anonymous_namespace{checkother .cpp}1210012
cppcheck::anonymous_namespace{checkpostf ixoperator.cpp}010001
cppcheck::anonymous_namespace{checksizeo f.cpp}010001
cppcheck::anonymous_namespace{checkstl .cpp}010001
cppcheck::anonymous_namespace{checktype .cpp}010001
cppcheck::anonymous_namespace{checkunini tvar.cpp}010001
cppcheck::anonymous_namespace{checkunuse dvar.cpp}010001
cppcheck::anonymous_namespace{checkvaarg .cpp}010001
cppcheck::anonymous_namespace{timer.cpp}110012
cppcheck::anonymous_namespace{tokenize .cpp}410011
cli::GlobalNamespace95980004
testrunner::GlobalNamespace263087400526
testrunner::anonymous_namespace{test64bi t.cpp}010001
testrunner::anonymous_namespace{testasse rt.cpp}010001
testrunner::anonymous_namespace{testauto variables.cpp}010001
testrunner::anonymous_namespace{testbool .cpp}010001
testrunner::anonymous_namespace{testboos t.cpp}010001
testrunner::anonymous_namespace{testbuff eroverrun.cpp}010001
testrunner::anonymous_namespace{testchar var.cpp}010001
testrunner::anonymous_namespace{testclas s.cpp}010001
testrunner::anonymous_namespace{testcmdl ineparser.cpp}010001
testrunner::anonymous_namespace{testcond ition.cpp}010001
testrunner::anonymous_namespace{testcons tructors.cpp}010001
testrunner::anonymous_namespace{testcppc heck.cpp}010001
testrunner::anonymous_namespace{testerro rlogger.cpp}010001
testrunner::anonymous_namespace{testexce ptionsafety.cpp}010001
testrunner::anonymous_namespace{testfile lister.cpp}010001
testrunner::anonymous_namespace{testgarb age.cpp}010001
testrunner::anonymous_namespace{testinco mpletestatement.cpp}010001
testrunner::anonymous_namespace{testio .cpp}010001
testrunner::anonymous_namespace{testleak autovar.cpp}010001
testrunner::anonymous_namespace{testlibr ary.cpp}010001
testrunner::anonymous_namespace{testmath lib.cpp}010001
testrunner::anonymous_namespace{testmeml eak.cpp}010001
testrunner::anonymous_namespace{testnonr eentrantfunctions.cpp}010001
testrunner::anonymous_namespace{testnull pointer.cpp}010001
testrunner::anonymous_namespace{testobso lescentfunctions.cpp}010001
testrunner::anonymous_namespace{testopti ons.cpp}010001
testrunner::anonymous_namespace{testothe r.cpp}010001
testrunner::anonymous_namespace{testpath .cpp}010001
testrunner::anonymous_namespace{testpath match.cpp}010001
testrunner::anonymous_namespace{testpost fixoperator.cpp}010001
testrunner::anonymous_namespace{testprep rocessor.cpp}010001
testrunner::anonymous_namespace{testsamp les.cpp}010001
testrunner::anonymous_namespace{testsimp lifytemplate.cpp}010001
testrunner::anonymous_namespace{testsimp lifytokens.cpp}010001
testrunner::anonymous_namespace{testsimp lifytypedef.cpp}010001
testrunner::anonymous_namespace{testsize of.cpp}010001
testrunner::anonymous_namespace{teststl .cpp}010001
testrunner::anonymous_namespace{teststri ng.cpp}010001
testrunner::anonymous_namespace{testsupp ressions.cpp}010001
testrunner::anonymous_namespace{testsymb oldatabase.cpp}010001
testrunner::anonymous_namespace{testthre adexecutor.cpp}010001
testrunner::anonymous_namespace{testtime r.cpp}010001
testrunner::anonymous_namespace{testtoke n.cpp}010001
testrunner::anonymous_namespace{testtoke nize.cpp}010001
testrunner::anonymous_namespace{testtype .cpp}010001
testrunner::anonymous_namespace{testunin itvar.cpp}010001
testrunner::anonymous_namespace{testunus edfunctions.cpp}010001
testrunner::anonymous_namespace{testunus edprivfunc.cpp}010001
testrunner::anonymous_namespace{testunus edvar.cpp}010001
testrunner::anonymous_namespace{testvaar g.cpp}010001
testrunner::anonymous_namespace{testvalu eflow.cpp}010001
testrunner::anonymous_namespace{testvari d.cpp}010001

172410
Project Rules  

  • 172 validated Rule(s)
  • 41 Rule(s) violated
  • 0 Rules or Queries with Error (syntax error, exception thrown, time-out)

490
Code Quality  

warningCritical    Critical Rule warning: Types too big - critical
• Rule Description:

This rule matches types with more than 500 lines of code.

Types where NbLinesOfCode > 500 are extremely complex to develop and maintain. See the definition of the NbLinesOfCode metric here http://www.cppdepend.com/Metrics.aspx#NbLinesOfCode

Maybe you are facing the God Class phenomenon: A God Class is a class that controls way too many other classes in the system and has grown beyond all logic to become The Class That Does Everything.


• How to Fix Violations:

Types with many lines of code should be split in a group of smaller types.

To refactor a God Class you'll need patience, and you might even need to recreate everything from scratch. Here are a few advices:

• Think before pulling out methods: on what data does this method operate? What responsibility does it have?

• Try to maintain the interface of the god class at first and delegate calls to the new extracted classes. In the end the god class should be a pure facade without own logic. Then you can keep it for convenience or throw it away and start to use the new classes only.

• Unit Tests can help: write tests for each method before extracting it to ensure you don't break functionality.

32 types matched

types# lines of code (LOC)# Methods# FieldsFull Name
Tokenizer5 7271559Tokenizer
TestTokenizer3 0123901TestTokenizer
TestPreprocessor1 7701920TestPreprocessor
TestOther1 5551200TestOther
TestSymbolDatabase1 5471546TestSymbolDatabase
Preprocessor1 490366Preprocessor
TestSimplifyTokens1 4291852TestSimplifyTokens
CheckOther1 3401060CheckOther
TestClass1 3381590TestClass
SymbolDatabase1 311279SymbolDatabase
CheckIO1 159390CheckIO
TestMemleakInFunction1 0731672TestMemleakInFunction
CheckClass1 065741CheckClass
CheckMemoryLeakInFunction995201CheckMemoryLeakInFunction
TestUninitVar984491TestUninitVar
TestBufferOverrun9761470TestBufferOverrun
TestUnusedVar9201280TestUnusedVar
Token85814317Token
CheckBufferOverrun842470CheckBufferOverrun
TestSimplifyTypedef8171310TestSimplifyTypedef
CheckStl760540CheckStl
TemplateSimplifier753200TemplateSimplifier
TestMathLib737330TestMathLib
TestNullPointer660551TestNullPointer
TestIO634291TestIO
TestCmdlineParser6271032TestCmdlineParser
TestStl627881TestStl
Library6085527Library
CheckUninitVar568311CheckUninitVar
TestToken567556TestToken
TestConstructors5641270TestConstructors
TestVarID5391350TestVarID

Statistics

Stat   # lines of code (LOC)   # Methods   # Fields
Sum:37 8523 25494
Average:1 182101.692.94
Minimum:539200
Maximum:5 72739027
Standard deviation:952.6374.265.68
Variance:907 5005 51432.25
warningCritical    Critical Rule warning: Methods too complex - critical
• Rule Description:

This rule matches methods where CyclomaticComplexity > 30 or ILCyclomaticComplexity > 60 or ILNestingDepth > 6. Such method is typically hard to understand and maintain.

Maybe you are facing the God Method phenomenon. A "God Method" is a method that does way too many processes in the system and has grown beyond all logic to become The Method That Does Everything. When need for new processes increases suddenly some programmers realize: why should I create a new method for each processe if I can only add an if.

See the definition of the CyclomaticComplexity metric here: http://www.cppdepend.com/Metrics.aspx#CC

See the definition of the NestingDepth metric here http://www.cppdepend.com/Metrics.aspx#NestingDepth


• How to Fix Violations:

A large and complex method should be split in smaller methods, or even one or several classes can be created for that.

During this process it is important to question the scope of each variable local to the method. This can be an indication if such local variable will become an instance field of the newly created class(es).

Large switch…case structures might be refactored through the help of a set of types that implement a common interface, the interface polymorphism playing the role of the switch cases tests.

Unit Tests can help: write tests for each method before extracting it to ensure you don't break functionality.

99 methods matched

methodsCyclomatic Complexity (CC)NestingDepthFull Name
checkWrongPrintfScanfArguments()34914CheckIO.checkWrongPrintfScanfArguments()
SymbolDatabase(constTokenizer*,constSettings*,ErrorLogger*)27919SymbolDatabase.SymbolDatabase(constTokenizer*,constSettings* ,ErrorLogger*)
simplifyTypedef()19710Tokenizer.simplifyTypedef()
getcode(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool ,unsignedint)1919CheckMemoryLeakInFunction.getcode(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool,unsignedint)
load(consttinyxml2::XMLDocument&)1488Library.load(consttinyxml2::XMLDocument&)
ParseFromArgs(int,constchar*const*)1306CmdLineParser.ParseFromArgs(int,constchar*const*)
ParseFromArgs(int,constchar*const*)1306CmdLineParser.ParseFromArgs(int,constchar*const*)
simplifycode(Token*)1247CheckMemoryLeakInFunction.simplifycode(Token*)
parse(constToken&,std::list<ExecutionPath*>&)1227UninitVar.parse(constToken&,std::list<ExecutionPath*>&)
checkFunctionVariableUsage_iterateScopes(constScope*const,Variables& ,bool)1197CheckUnusedVar.checkFunctionVariableUsage_iterateScopes (constScope*const,Variables&,bool)
simplifyEnum()11111Tokenizer.simplifyEnum()
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)987__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
setVarId()969Tokenizer.setVarId()
getcfgs(conststd::string&,conststd::string&,conststd::map<std::string ,std::string>&)966Preprocessor.getcfgs(conststd::string&,conststd::string&,conststd::map <std::string,std::string>&)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)926Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)
checkScopeForVariable(constToken*,constVariable&,bool*const,bool*const ,CheckUninitVar::Alloc*const,conststd::string&)857CheckUninitVar.checkScopeForVariable(constToken*,constVariable& ,bool*const,bool*const,CheckUninitVar::Alloc*const,conststd::string&)
checkScope(constToken*const,VarInfo*,std::set<unsignedint>)827CheckLeakAutoVar.checkScope(constToken*const,VarInfo*,std::set <unsignedint>)
checkScope(constToken*,std::list<ExecutionPath*>&)8110ExecutionPath.checkScope(constToken*,std::list<ExecutionPath*>&)
valueFlowBeforeCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)817__Globals.valueFlowBeforeCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
simplifyVarDecl(Token*,Token*,bool)807Tokenizer.simplifyVarDecl(Token*,Token*,bool)
checkFileUsage()709CheckIO.checkFileUsage()
initializeVarList(constFunction&,std::list<constFunction*>& ,constScope*,std::vector<Usage>&)647CheckClass.initializeVarList(constFunction&,std::list<constFunction*>& ,constScope*,std::vector<Usage>&)
removeComments(conststd::string&,conststd::string&)6310Preprocessor.removeComments(conststd::string&,conststd::string&)
simplifyKnownVariables()637Tokenizer.simplifyKnownVariables()
checkScope(constToken*,conststd::vector<std::string>& ,constCheckBufferOverrun::ArrayInfo&)578CheckBufferOverrun.checkScope(constToken*,conststd::vector<std::string >&,constCheckBufferOverrun::ArrayInfo&)
expandMacros(conststd::string&,std::string,conststd::string& ,ErrorLogger*)569Preprocessor.expandMacros(conststd::string&,std::string ,conststd::string&,ErrorLogger*)
eraseDeadCode(Token*,constToken*)548Tokenizer.eraseDeadCode(Token*,constToken*)
valueFlowAfterCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)528__Globals.valueFlowAfterCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
parseTokens(constTokenizer&,constchar*,constSettings*)526CheckUnusedFunctions.parseTokens(constTokenizer&,constchar* ,constSettings*)
handleIncludes(conststd::string&,conststd::string&,conststd::list <std::string>&,std::map<std::string,std::string>&,std::set<std::string >&,std::list<std::string>)516Preprocessor.handleIncludes(conststd::string&,conststd::string& ,conststd::list<std::string>&,std::map<std::string,std::string>& ,std::set<std::string>&,std::list<std::string>)
getcode(conststd::string&,conststd::string&,conststd::string&)507Preprocessor.getcode(conststd::string&,conststd::string& ,conststd::string&)
simplifyCalculations(Token*)476TemplateSimplifier.simplifyCalculations(Token*)
checkRedundantAssignment()469CheckOther.checkRedundantAssignment()
string_c_str()467CheckStl.string_c_str()
simplifyMathFunctions()466Tokenizer.simplifyMathFunctions()
doAssignment(Variables&,constToken*,bool,constScope*)4510__Globals.doAssignment(Variables&,constToken*,bool,constScope*)
setTokenValue(Token*,constValueFlow::Value&)457__Globals.setTokenValue(Token*,constValueFlow::Value&)
constructors()457CheckClass.constructors()
simplifyTemplateInstantiations(TokenList&,ErrorLogger*,constSettings* ,constToken*,std::list<Token*>&,std::set<std::string>&)448TemplateSimplifier.simplifyTemplateInstantiations(TokenList& ,ErrorLogger*,constSettings*,constToken*,std::list<Token*>&,std::set <std::string>&)
checkStructVariable(constVariable*const)447CheckMemoryLeakStructMember.checkStructVariable(constVariable*const)
simplifyCondition(conststd::map<std::string,std::string>&,std::string& ,bool)426Preprocessor.simplifyCondition(conststd::map<std::string,std::string>& ,std::string&,bool)
simplifySizeof()417Tokenizer.simplifySizeof()
checkConstFunc(constScope*,constFunction*,bool&)406CheckClass.checkConstFunc(constScope*,constFunction*,bool&)
duplicateTypedef(Token**,constToken*,constToken*,conststd::set <std::string>&)398Tokenizer.duplicateTypedef(Token**,constToken*,constToken* ,conststd::set<std::string>&)
checkStructVariable()3811CheckBufferOverrun.checkStructVariable()
checkScope(constToken*,constCheckBufferOverrun::ArrayInfo&)389CheckBufferOverrun.checkScope(constToken* ,constCheckBufferOverrun::ArrayInfo&)
useDefaultArgumentValues(conststd::list<Token*>&,std::list<Token*>*)377TemplateSimplifier.useDefaultArgumentValues(conststd::list<Token*>& ,std::list<Token*>*)
checkIncorrectLogicOperator()376CheckCondition.checkIncorrectLogicOperator()
code(conststd::vector<std::string>&,conststd::map<std::string ,PreprocessorMacro*>&,std::string&)359PreprocessorMacro.code(conststd::vector<std::string>&,conststd::map <std::string,PreprocessorMacro*>&,std::string&)
createTokens(std::istream&,conststd::string&)358TokenList.createTokens(std::istream&,conststd::string&)
findFunction(constToken*)358Scope.findFunction(constToken*)
ArgumentInfo(constToken*,constSettings*)358CheckIO+ArgumentInfo.ArgumentInfo(constToken*,constSettings*)
simplifyFunctionParameters()357Tokenizer.simplifyFunctionParameters()
hasComplicatedSyntaxErrorsInTemplates(Token*)346TemplateSimplifier.hasComplicatedSyntaxErrorsInTemplates(Token*)
addClassFunction(Scope**,constToken**,constToken*)339SymbolDatabase.addClassFunction(Scope**,constToken**,constToken*)
virtualDestructor()338CheckClass.virtualDestructor()
pushback()336CheckStl.pushback()
expandTemplate(TokenList&,constToken*,conststd::string&,std::vector <constToken*>&,conststd::string&,std::vector<constToken*>&,std::list <Token*>&)327TemplateSimplifier.expandTemplate(TokenList&,constToken* ,conststd::string&,std::vector<constToken*>&,conststd::string& ,std::vector<constToken*>&,std::list<Token*>&)
addArguments(constSymbolDatabase*,constScope*)318Function.addArguments(constSymbolDatabase*,constScope*)
simplifyStructDecl()317Tokenizer.simplifyStructDecl()
removeUnnecessaryQualification()317Tokenizer.removeUnnecessaryQualification()
variable(constScope*,constToken*)317CheckMemoryLeakInClass.variable(constScope*,constToken*)
checkUnreachableCode()309CheckOther.checkUnreachableCode()
simplifyComma()307Tokenizer.simplifyComma()
checkFunctionParameter(constToken&,constunsignedint ,constCheckBufferOverrun::ArrayInfo&,conststd::list<constToken*>&)307CheckBufferOverrun.checkFunctionParameter(constToken&,constunsignedint ,constCheckBufferOverrun::ArrayInfo&,conststd::list<constToken*>&)
oppositeInnerCondition()306CheckCondition.oppositeInnerCondition()
checkStructMemberUsage()306CheckUnusedVar.checkStructMemberUsage()
checkConst()297CheckClass.checkConst()
parseFunctionCall(constToken&,std::list<constToken*>&,constLibrary* ,unsignedchar)297CheckNullPointer.parseFunctionCall(constToken&,std::list<constToken*>& ,constLibrary*,unsignedchar)
pointerassignment()296Check64BitPortability.pointerassignment()
checkMemset()287CheckClass.checkMemset()
nullConstantDereference()287CheckNullPointer.nullConstantDereference()
autoVariables()286CheckAutoVariables.autoVariables()
analyseFunctions(constToken*const,std::set<std::string>&)278UninitVar.analyseFunctions(constToken*const,std::set<std::string>&)
clarifyCondition()276CheckCondition.clarifyCondition()
simplifyCompoundAssignment()268Tokenizer.simplifyCompoundAssignment()
copyconstructors()268CheckClass.copyconstructors()
checkScope(constScope*)267CheckUninitVar.checkScope(constScope*)
checkLoopBody(constToken*,constVariable&,constCheckUninitVar::Alloc ,conststd::string&,constbool)267CheckUninitVar.checkLoopBody(constToken*,constVariable& ,constCheckUninitVar::Alloc,conststd::string&,constbool)
simplifyFlowControl()266Tokenizer.simplifyFlowControl()
checkVariableScope()266CheckOther.checkVariableScope()
checkMathFunctions()266CheckOther.checkMathFunctions()
checkDuplicateExpression()259CheckOther.checkDuplicateExpression()
checkAutoPointer()258CheckStl.checkAutoPointer()
processFile(conststd::string&,std::istream&)256CppCheck.processFile(conststd::string&,std::istream&)
simplifyIfAndWhileAssign()247Tokenizer.simplifyIfAndWhileAssign()
valueFlowCheckArrayIndex(constToken*const ,constCheckBufferOverrun::ArrayInfo&)247CheckBufferOverrun.valueFlowCheckArrayIndex(constToken*const ,constCheckBufferOverrun::ArrayInfo&)
assertWithSideEffects()238CheckAssert.assertWithSideEffects()
checkMinSizes(conststd::list<Library::ArgumentChecks::MinSize>& ,constToken*const,conststd::size_t,constToken**,constSettings*const)236__Globals.checkMinSizes(conststd::list <Library::ArgumentChecks::MinSize>&,constToken*const,conststd::size_t ,constToken**,constSettings*const)
stlOutOfBounds()236CheckStl.stlOutOfBounds()
handleIncludes(std::string&,conststd::string&,conststd::list <std::string>&)236Preprocessor.handleIncludes(std::string&,conststd::string& ,conststd::list<std::string>&)
checkSignConversion()227CheckType.checkSignConversion()
isFunctionParameterPassedByValue(constToken*)226Tokenizer.isFunctionParameterPassedByValue(constToken*)
duplicateDefinition(Token**,constToken*)226Tokenizer.duplicateDefinition(Token**,constToken*)
if_find()226CheckStl.if_find()
simplifyLabelsCaseDefault()216Tokenizer.simplifyLabelsCaseDefault()
simplifyConstTernaryOp()216Tokenizer.simplifyConstTernaryOp()
use(std::list<ExecutionPath*>&,constToken*,constint)216UninitVar.use(std::list<ExecutionPath*>&,constToken*,constint)
preprocessCleanupDirectives(conststd::string&)216Preprocessor.preprocessCleanupDirectives(conststd::string&)

Statistics

Stat   Cyclomatic Complexity (CC)   NestingDepth
Sum:5 451736
Average:55.067.43
Minimum:216
Maximum:34919
Standard deviation:51.691.83
Variance:2 6713.34
warningCritical    Critical Rule warning: Methods with too many parameters - critical
• Rule Description:

This rule matches methods with more than 8 parameters. Such method is painful to call and might degrade performance. See the definition of the NbParameters metric here: http://www.cppdepend.com/Metrics.aspx#NbParameters


• How to Fix Violations:

More properties/fields can be added to the declaring type to handle numerous states. An alternative is to provide a class or a structure dedicated to handle arguments passing.

2 methods matched

methods# ParametersFull Name
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)9__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)9Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)

Statistics

Stat   # Parameters
Sum:18
Average:9
Minimum:9
Maximum:9
Standard deviation:0
Variance:0
warningCritical    Rule warning: Quick summary of methods to refactor
• Rule Description:

Methods matched by this rule somehow violate one or several basic quality principles, whether it is too large (too many lines of code), too complex (too many if, switch case, loops…) has too many variables, too many parameters or has too many overloads.


• How to Fix Violations:

To refactor such method and increase code quality and maintainability, certainly you'll have to split the method into several smaller methods or even create one or several classes to implement the logic.

During this process it is important to question the scope of each variable local to the method. This can be an indication if such local variable will become an instance field of the newly created class(es).

Large switch…case structures might be refactored through the help of a set of types that implement a common interface, the interface polymorphism playing the role of the switch cases tests.

Unit Tests can help: write tests for each method before extracting it to ensure you don't break functionality.

520 methods matched

methods# lines of code (LOC)MaxNestedLoopCyclomatic Complexity (CC)NestingDepth# Parameters# Variables# OverloadsFull Name
checkMinSizes(conststd::list<Library::ArgumentChecks::MinSize>& ,constToken*const,conststd::size_t,constToken**,constSettings*const)5522365111__Globals.checkMinSizes(conststd::list <Library::ArgumentChecks::MinSize>&,constToken*const,conststd::size_t ,constToken**,constSettings*const)
isSameExpression(constToken*,constToken*,conststd::set<std::string>&)551233391__Globals.isSameExpression(constToken*,constToken*,conststd::set <std::string>&)
astGetSizeSign(constSettings*,constToken*,unsignedint*,char*)531244451__Globals.astGetSizeSign(constSettings*,constToken*,unsignedint*,char* )
doAssignment(Variables&,constToken*,bool,constScope*)115145104111__Globals.doAssignment(Variables&,constToken*,bool,constScope*)
getparams(conststd::string&,std::string::size_type&,std::vector <std::string>&,unsignedint&,bool&)371184531__Globals.getparams(conststd::string&,std::string::size_type& ,std::vector<std::string>&,unsignedint&,bool&)
getlines(std::istream&,std::string&)362165231__Globals.getlines(std::istream&,std::string&)
multiComparePercent(constToken*,constchar*&,bool,unsignedint)890375401__Globals.multiComparePercent(constToken*,constchar*&,bool,unsignedint )
splitDefinitionFromTypedef(Token*)491114151__Globals.splitDefinitionFromTypedef(Token*)
processFunc(Token*,bool)331175201__Globals.processFunc(Token*,bool)
setVarIdParseDeclaration(constToken**,conststd::map<std::string ,unsignedint>&,bool,bool,bool)551234571__Globals.setVarIdParseDeclaration(constToken**,conststd::map <std::string,unsignedint>&,bool,bool,bool)
setVarIdClassDeclaration(Token*const,conststd::map<std::string ,unsignedint>&,constunsignedint,std::map<unsignedint,std::map <std::string,unsignedint>>*,unsignedint*)421225591__Globals.setVarIdClassDeclaration(Token*const,conststd::map <std::string,unsignedint>&,constunsignedint,std::map<unsignedint ,std::map<std::string,unsignedint>>*,unsignedint*)
setVarIdClassFunction(conststd::string&,Token*const,constToken*const ,conststd::map<std::string,unsignedint>&,std::map<unsignedint,std::map <std::string,unsignedint>>*,unsignedint*)131113621__Globals.setVarIdClassFunction(conststd::string&,Token*const ,constToken*const,conststd::map<std::string,unsignedint>&,std::map <unsignedint,std::map<std::string,unsignedint>>*,unsignedint*)
linkBrackets(Tokenizer*,std::stack<constToken*>&,std::stack<Token*>& ,Token*,char,char)11053601__Globals.linkBrackets(Tokenizer*,std::stack<constToken*>&,std::stack <Token*>&,Token*,char,char)
compileTerm(Token*&,AST_state&)341144201__Globals.compileTerm(Token*&,AST_state&)
compilePrecedence2(Token*&,AST_state&)461124281__Globals.compilePrecedence2(Token*&,AST_state&)
compilePrecedence3(Token*&,AST_state&)592235251__Globals.compilePrecedence3(Token*&,AST_state&)
createAstAtToken(Token*,bool)6922842131__Globals.createAstAtToken(Token*,bool)
execute(constToken*,std::map<unsignedint,MathLib::bigint>*const ,MathLib::bigint*,bool*)10504044111__Globals.execute(constToken*,std::map<unsignedint,MathLib::bigint >*const,MathLib::bigint*,bool*)
bailoutFunctionPar(constToken*,constValueFlow::Value&,constSettings* ,bool*)321153431__Globals.bailoutFunctionPar(constToken*,constValueFlow::Value& ,constSettings*,bool*)
setTokenValue(Token*,constValueFlow::Value&)9034572121__Globals.setTokenValue(Token*,constValueFlow::Value&)
valueFlowBeforeCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)15548174231__Globals.valueFlowBeforeCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)20639879391__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
valueFlowAfterAssign(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)182113491__Globals.valueFlowAfterAssign(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)
valueFlowAfterCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)10245284231__Globals.valueFlowAfterCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
valueFlowForLoop1(constToken*,unsignedint*const,MathLib::bigint*const ,MathLib::bigint*const,MathLib::bigint*const)331162531__Globals.valueFlowForLoop1(constToken*,unsignedint*const ,MathLib::bigint*const,MathLib::bigint*const,MathLib::bigint*const)
valueFlowForLoop2(constToken*,std::map<unsignedint,MathLib::bigint>* ,std::map<unsignedint,MathLib::bigint>*,std::map<unsignedint ,MathLib::bigint>*)3511034111__Globals.valueFlowForLoop2(constToken*,std::map<unsignedint ,MathLib::bigint>*,std::map<unsignedint,MathLib::bigint>*,std::map <unsignedint,MathLib::bigint>*)
valueFlowForLoopSimplify(Token*const,constunsignedint ,constMathLib::bigint,TokenList*,ErrorLogger*,constSettings*)482245671__Globals.valueFlowForLoopSimplify(Token*const,constunsignedint ,constMathLib::bigint,TokenList*,ErrorLogger*,constSettings*)
valueFlowForLoopSimplifyAfter(Token*,unsignedint,constMathLib::bigint ,TokenList*,ErrorLogger*,constSettings*)16153651__Globals.valueFlowForLoopSimplifyAfter(Token*,unsignedint ,constMathLib::bigint,TokenList*,ErrorLogger*,constSettings*)
valueFlowForLoop(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)2621244111__Globals.valueFlowForLoop(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)
valueFlowInjectParameter(TokenList*,ErrorLogger*,constSettings* ,constVariable*,constScope*,conststd::list<ValueFlow::Value>&)6031611__Globals.valueFlowInjectParameter(TokenList*,ErrorLogger* ,constSettings*,constVariable*,constScope*,conststd::list <ValueFlow::Value>&)
valueFlowFunctionReturn(TokenList*,ErrorLogger*,constSettings*)3821943101__Globals.valueFlowFunctionReturn(TokenList*,ErrorLogger* ,constSettings*)
toLongNumber(conststd::string&)3711231111MathLib.toLongNumber(conststd::string&)
toULongNumber(conststd::string&)3311031111MathLib.toULongNumber(conststd::string&)
isFloat(conststd::string&)901393131MathLib.isFloat(conststd::string&)
isHex(conststd::string&)361133131MathLib.isHex(conststd::string&)
isBin(conststd::string&)361133131MathLib.isBin(conststd::string&)
isValidSuffix(std::string::const_iterator,std::string::const_iterator)551213221MathLib.isValidSuffix(std::string::const_iterator ,std::string::const_iterator)
swapWithNext()35022011Token.swapWithNext()
Match(constToken*,constchar*,unsignedint)512245351Token.Match(constToken*,constchar*,unsignedint)
multiCompare(constToken*,constchar*,unsignedint)341154341Token.multiCompare(constToken*,constchar*,unsignedint)
stringifyList(bool,bool,bool,bool,bool,conststd::vector<std::string>* ,constToken*)402156763Token.stringifyList(bool,bool,bool,bool,bool,conststd::vector <std::string>*,constToken*)
deleteThis()41073011Token.deleteThis()
update_property_info()350173001Token.update_property_info()
printValueFlow(bool,std::ostream&)382164231Token.printValueFlow(bool,std::ostream&)
match(conststd::string&,conststd::string&)313125241Suppressions+FileMatcher.match(conststd::string&,conststd::string&)
ErrorMessage(conststd::list<constToken*>&,constTokenList* ,Severity::SeverityType,conststd::string&,conststd::string&,bool)11152615ErrorLogger+ErrorMessage.ErrorMessage(conststd::list<constToken*>& ,constTokenList*,Severity::SeverityType,conststd::string& ,conststd::string&,bool)
toXML(bool,int)321103231ErrorLogger+ErrorMessage.toXML(bool,int)
deserialize(conststd::string&)4721331131ErrorLogger+ErrorMessage.deserialize(conststd::string&)
addtoken(conststd::string&,constunsignedint,constunsignedint,bool)31193442TokenList.addtoken(conststd::string&,constunsignedint,constunsignedint ,bool)
createTokens(std::istream&,conststd::string&)10623582151TokenList.createTokens(std::istream&,conststd::string&)
setVarId()19739690361Tokenizer.setVarId()
simplifyTokenList1(constchar*)19025351161Tokenizer.simplifyTokenList1(constchar*)
simplifyTokenList2()12223450151Tokenizer.simplifyTokenList2()
eraseDeadCode(Token*,constToken*)14425482201Tokenizer.eraseDeadCode(Token*,constToken*)
simplifyMulAndParens()433187051Tokenizer.simplifyMulAndParens()
isFunctionParameterPassedByValue(constToken*)472226181Tokenizer.isFunctionParameterPassedByValue(constToken*)
arraySize()372147071Tokenizer.arraySize()
simplifyLabelsCaseDefault()432216051Tokenizer.simplifyLabelsCaseDefault()
removeMacrosInGlobalScope()372195071Tokenizer.removeMacrosInGlobalScope()
removeRedundantAssignment()323156061Tokenizer.removeRedundantAssignment()
simplifySizeof()10224170171Tokenizer.simplifySizeof()
simplifyVarDecl(Token*,Token*,bool)17938073162Tokenizer.simplifyVarDecl(Token*,Token*,bool)
simplifyPlatformTypes()921345091Tokenizer.simplifyPlatformTypes()
simplifyStdType()631255031Tokenizer.simplifyStdType()
simplifyConstTernaryOp()442216071Tokenizer.simplifyConstTernaryOp()
simplifyCompoundAssignment()602268081Tokenizer.simplifyCompoundAssignment()
simplifyIfAndWhileAssign()6422470111Tokenizer.simplifyIfAndWhileAssign()
simplifyIfNot()372124021Tokenizer.simplifyIfNot()
simplifyIfNotNull()311145031Tokenizer.simplifyIfNotNull()
simplifyComma()5723070101Tokenizer.simplifyComma()
simplifyAddBracesToCommand(Token*)340155141Tokenizer.simplifyAddBracesToCommand(Token*)
simplifyAddBracesPair(Token*,bool)4711462101Tokenizer.simplifyAddBracesPair(Token*,bool)
simplifyTypedef()6434197100791Tokenizer.simplifyTypedef()
simplifyCasts()432204051Tokenizer.simplifyCasts()
simplifyKnownVariables()13136370381Tokenizer.simplifyKnownVariables()
simplifyKnownVariablesGetData(unsignedint,Token**,Token**,std::string& ,unsignedint&,bool&,bool)411144761Tokenizer.simplifyKnownVariablesGetData(unsignedint,Token**,Token** ,std::string&,unsignedint&,bool&,bool)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)23329269231Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)
simplifyFlowControl()443266061Tokenizer.simplifyFlowControl()
simplifyConditions()9523550121Tokenizer.simplifyConditions()
removeRedundantConditions()31194051Tokenizer.removeRedundantConditions()
removeRedundantFor()4921860141Tokenizer.removeRedundantFor()
simplifyStructDecl()8723170131Tokenizer.simplifyStructDecl()
simplifyRedundantParentheses()883315051Tokenizer.simplifyRedundantParentheses()
simplifyReference()183117061Tokenizer.simplifyReference()
simplifyFunctionParameters()9433570121Tokenizer.simplifyFunctionParameters()
simplifyDoublePlusAndDoubleMinus()332176011Tokenizer.simplifyDoublePlusAndDoubleMinus()
simplifyMathFunctions()15824660421Tokenizer.simplifyMathFunctions()
simplifyMathExpressions()7014350211Tokenizer.simplifyMathExpressions()
simplifyEnum()3224111110571Tokenizer.simplifyEnum()
simplifyFunctionPointers()492293041Tokenizer.simplifyFunctionPointers()
createLinks2()342204041Tokenizer.createLinks2()
simplifyAttribute()563275061Tokenizer.simplifyAttribute()
simplifyKeyword()392224061Tokenizer.simplifyKeyword()
simplifyAsm()372134061Tokenizer.simplifyAsm()
simplifyBuiltinExpect()15286031Tokenizer.simplifyBuiltinExpect()
removeUnnecessaryQualification()6123170101Tokenizer.removeUnnecessaryQualification()
simplifyNamespaceStd()3011130101Tokenizer.simplifyNamespaceStd()
simplifyMicrosoftStringFunctions()1112705021Tokenizer.simplifyMicrosoftStringFunctions()
simplifyBorland()283156041Tokenizer.simplifyBorland()
simplifyQtSignalsSlots()332164031Tokenizer.simplifyQtSignalsSlots()

Statistics

Stat   # lines of code (LOC)   MaxNestedLoop   Cyclomatic Complexity (CC)   NestingDepth   # Parameters   # Variables   # Overloads
Sum:32 00963112 1212 5185864 988558
Average:61.561.2123.314.841.139.591.07
Minimum:1011001
Maximum:69863753191085
Standard deviation:71.731.2538.253.711.8511.880.4
Variance:5 1451.561 46313.783.41141.20.16
warningCritical    Rule warning: Methods too big
• Rule Description:

This rule matches methods where NbLinesOfCode > 30 or (commented per default) NbILInstructions > 200. Such method can be hard to understand and maintain.

However rules like Methods too complex or Methods with too many variables might be more relevant to detect painful to maintain methods, because complexity is more related to numbers of if, switch case, loops… than to just number of lines.

See the definition of the NbLinesOfCode metric here http://www.cppdepend.com/Metrics.aspx#NbLinesOfCode


• How to Fix Violations:

Usually too big methods should be split in smaller methods.

But long methods with no branch conditions, that typically initialize some data, are not necessarily a problem to maintain nor to test, and might not need refactoring.

396 methods matched

methods# lines of code (LOC)Full Name
SymbolDatabase(constTokenizer*,constSettings*,ErrorLogger*)698SymbolDatabase.SymbolDatabase(constTokenizer*,constSettings* ,ErrorLogger*)
checkWrongPrintfScanfArguments()691CheckIO.checkWrongPrintfScanfArguments()
simplifyTypedef()643Tokenizer.simplifyTypedef()
getcode(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool ,unsignedint)410CheckMemoryLeakInFunction.getcode(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool,unsignedint)
ParseFromArgs(int,constchar*const*)387CmdLineParser.ParseFromArgs(int,constchar*const*)
ParseFromArgs(int,constchar*const*)387CmdLineParser.ParseFromArgs(int,constchar*const*)
load(consttinyxml2::XMLDocument&)377Library.load(consttinyxml2::XMLDocument&)
run()375TestTokenizer.run()
simplifycode(Token*)328CheckMemoryLeakInFunction.simplifycode(Token*)
simplifyEnum()322Tokenizer.simplifyEnum()
parse(constToken&,std::list<ExecutionPath*>&)264UninitVar.parse(constToken&,std::list<ExecutionPath*>&)
checkFunctionVariableUsage_iterateScopes(constScope*const,Variables& ,bool)263CheckUnusedVar.checkFunctionVariableUsage_iterateScopes (constScope*const,Variables&,bool)
getcfgs(conststd::string&,conststd::string&,conststd::map<std::string ,std::string>&)247Preprocessor.getcfgs(conststd::string&,conststd::string&,conststd::map <std::string,std::string>&)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)233Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)206__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
setVarId()197Tokenizer.setVarId()
simplifyTokenList1(constchar*)190Tokenizer.simplifyTokenList1(constchar*)
checkScopeForVariable(constToken*,constVariable&,bool*const,bool*const ,CheckUninitVar::Alloc*const,conststd::string&)188CheckUninitVar.checkScopeForVariable(constToken*,constVariable& ,bool*const,bool*const,CheckUninitVar::Alloc*const,conststd::string&)
testScanfArgument()185TestIO.testScanfArgument()
removeComments(conststd::string&,conststd::string&)184Preprocessor.removeComments(conststd::string&,conststd::string&)
run()181TestPreprocessor.run()
simplifyVarDecl(Token*,Token*,bool)179Tokenizer.simplifyVarDecl(Token*,Token*,bool)
checkScope(constToken*const,VarInfo*,std::set<unsignedint>)179CheckLeakAutoVar.checkScope(constToken*const,VarInfo*,std::set <unsignedint>)
checkFileUsage()177CheckIO.checkFileUsage()
checkScope(constToken*,std::list<ExecutionPath*>&)177ExecutionPath.checkScope(constToken*,std::list<ExecutionPath*>&)
run()171TestSimplifyTokens.run()
simplifyMathFunctions()158Tokenizer.simplifyMathFunctions()
testPrintfArgument()158TestIO.testPrintfArgument()
run()158TestMemleakInFunction.run()
expandMacros(conststd::string&,std::string,conststd::string& ,ErrorLogger*)156Preprocessor.expandMacros(conststd::string&,std::string ,conststd::string&,ErrorLogger*)
valueFlowBeforeCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)155__Globals.valueFlowBeforeCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
eraseDeadCode(Token*,constToken*)144Tokenizer.eraseDeadCode(Token*,constToken*)
run()144TestSymbolDatabase.run()
uninitvar1()144TestUninitVar.uninitvar1()
initializeVarList(constFunction&,std::list<constFunction*>& ,constScope*,std::vector<Usage>&)143CheckClass.initializeVarList(constFunction&,std::list<constFunction*>& ,constScope*,std::vector<Usage>&)
run()137TestBufferOverrun.run()
run()137TestClass.run()
simplifyKnownVariables()131Tokenizer.simplifyKnownVariables()
handleIncludes(conststd::string&,conststd::string&,conststd::list <std::string>&,std::map<std::string,std::string>&,std::set<std::string >&,std::list<std::string>)131Preprocessor.handleIncludes(conststd::string&,conststd::string& ,conststd::list<std::string>&,std::map<std::string,std::string>& ,std::set<std::string>&,std::list<std::string>)
uninitvar2()131TestUninitVar.uninitvar2()
printOut(constchar*)129SymbolDatabase.printOut(constchar*)
createLinks()128TestTokenizer.createLinks()
getcode(conststd::string&,conststd::string&,conststd::string&)127Preprocessor.getcode(conststd::string&,conststd::string& ,conststd::string&)
run()127TestVarID.run()
isVariableUsage(constToken*,bool,CheckUninitVar::Alloc)125CheckUninitVar.isVariableUsage(constToken*,bool,CheckUninitVar::Alloc)
isNullValue()125TestMathLib.isNullValue()
testgetcode()124TestMemleakInFunction.testgetcode()
simplifyTokenList2()122Tokenizer.simplifyTokenList2()
run()121TestSimplifyTypedef.run()
run()119TestConstructors.run()
run()119TestUnusedVar.run()
checkRedundantAssignment()118CheckOther.checkRedundantAssignment()
checkScope(constToken*,conststd::vector<std::string>& ,constCheckBufferOverrun::ArrayInfo&)116CheckBufferOverrun.checkScope(constToken*,conststd::vector<std::string >&,constCheckBufferOverrun::ArrayInfo&)
doAssignment(Variables&,constToken*,bool,constScope*)115__Globals.doAssignment(Variables&,constToken*,bool,constScope*)
simplifyCalculations(Token*)113TemplateSimplifier.simplifyCalculations(Token*)
simplifyMicrosoftStringFunctions()111Tokenizer.simplifyMicrosoftStringFunctions()
parseTokens(constTokenizer&,constchar*,constSettings*)111CheckUnusedFunctions.parseTokens(constTokenizer&,constchar* ,constSettings*)
createTokens(std::istream&,conststd::string&)106TokenList.createTokens(std::istream&,conststd::string&)
localvaralias1()106TestUnusedVar.localvaralias1()
execute(constToken*,std::map<unsignedint,MathLib::bigint>*const ,MathLib::bigint*,bool*)105__Globals.execute(constToken*,std::map<unsignedint,MathLib::bigint >*const,MathLib::bigint*,bool*)
simplifyTemplateInstantiations(TokenList&,ErrorLogger*,constSettings* ,constToken*,std::list<Token*>&,std::set<std::string>&)104TemplateSimplifier.simplifyTemplateInstantiations(TokenList& ,ErrorLogger*,constSettings*,constToken*,std::list<Token*>&,std::set <std::string>&)
call_func(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool& ,unsignedint)103CheckMemoryLeakInFunction.call_func(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool&,unsignedint)
run()103TestOther.run()
valueFlowAfterCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)102__Globals.valueFlowAfterCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
simplifySizeof()102Tokenizer.simplifySizeof()
localvar1()100TestUnusedVar.localvar1()
ArgumentInfo(constToken*,constSettings*)99CheckIO+ArgumentInfo.ArgumentInfo(constToken*,constSettings*)
pointerCheckAndDeRef()99TestNullPointer.pointerCheckAndDeRef()
isfloat()97TestMathLib.isfloat()
simplifyConditions()95Tokenizer.simplifyConditions()
string_c_str()95CheckStl.string_c_str()
simplifyFunctionParameters()94Tokenizer.simplifyFunctionParameters()
addClassFunction(Scope**,constToken**,constToken*)94SymbolDatabase.addClassFunction(Scope**,constToken**,constToken*)
checkStructVariable(constVariable*const)93CheckMemoryLeakStructMember.checkStructVariable(constVariable*const)
valueFlowAfterAssign()93TestValueFlow.valueFlowAfterAssign()
simplifyPlatformTypes()92Tokenizer.simplifyPlatformTypes()
checkIncorrectLogicOperator()91CheckCondition.checkIncorrectLogicOperator()
setTokenValue(Token*,constValueFlow::Value&)90__Globals.setTokenValue(Token*,constValueFlow::Value&)
isFloat(conststd::string&)90MathLib.isFloat(conststd::string&)
run()90TestCmdlineParser.run()
simplifyInitVar()90TestTokenizer.simplifyInitVar()
multiComparePercent(constToken*,constchar*&,bool,unsignedint)89__Globals.multiComparePercent(constToken*,constchar*&,bool,unsignedint )
duplicateTypedef(Token**,constToken*,constToken*,conststd::set <std::string>&)89Tokenizer.duplicateTypedef(Token**,constToken*,constToken* ,conststd::set<std::string>&)
simplifyRedundantParentheses()88Tokenizer.simplifyRedundantParentheses()
simplifyCondition(conststd::map<std::string,std::string>&,std::string& ,bool)88Preprocessor.simplifyCondition(conststd::map<std::string,std::string>& ,std::string&,bool)
uninitvar2_structmembers()88TestUninitVar.uninitvar2_structmembers()
simplifyStructDecl()87Tokenizer.simplifyStructDecl()
useDefaultArgumentValues(conststd::list<Token*>&,std::list<Token*>*)87TemplateSimplifier.useDefaultArgumentValues(conststd::list<Token*>& ,std::list<Token*>*)
argsMatch(constScope*,constToken*,constToken*,conststd::string& ,unsignedint)86Function.argsMatch(constScope*,constToken*,constToken* ,conststd::string&,unsignedint)
convert()86TestMathLib.convert()
code(conststd::vector<std::string>&,conststd::map<std::string ,PreprocessorMacro*>&,std::string&)85PreprocessorMacro.code(conststd::vector<std::string>&,conststd::map <std::string,PreprocessorMacro*>&,std::string&)
simplifycode()85TestMemleakInFunction.simplifycode()
pointerDerefAndCheck()82TestNullPointer.pointerDerefAndCheck()
doublefree1()80TestLeakAutoVar.doublefree1()
duplicateExpression1()80TestOther.duplicateExpression1()
simplifyTypedefFunction1()80TestSimplifyTypedef.simplifyTypedefFunction1()
checkGlobalAndLocalVariable()79CheckBufferOverrun.checkGlobalAndLocalVariable()
run()79TestStl.run()
checkScope(constToken*,constCheckBufferOverrun::ArrayInfo&)78CheckBufferOverrun.checkScope(constToken* ,constCheckBufferOverrun::ArrayInfo&)
constructors()78CheckClass.constructors()

Statistics

Stat   # lines of code (LOC)
Sum:29 586
Average:74.71
Minimum:31
Maximum:698
Standard deviation:77.57
Variance:6 017
warningCritical    Rule warning: Methods too complex
• Rule Description:

This rule matches methods where CyclomaticComplexity > 20 or ILCyclomaticComplexity > 40 or ILNestingDepth > 4. Such method is typically hard to understand and maintain.

See the definition of the CyclomaticComplexity metric here: http://www.cppdepend.com/Metrics.aspx#CC

See the definition of the NestingDepth metric here: http://www.cppdepend.com/Metrics.aspx#NestingDepth


• How to Fix Violations:

A large and complex method should be split in smaller methods, or even one or several classes can be created for that.

During this process it is important to question the scope of each variable local to the method. This can be an indication if such local variable will become an instance field of the newly created class(es).

Large switch…case structures might be refactored through the help of a set of types that implement a common interface, the interface polymorphism playing the role of the switch cases tests.

Unit Tests can help: write tests for each method before extracting it to ensure you don't break functionality.

294 methods matched

methodsCyclomatic Complexity (CC)MaxNestedLoopNestingDepthFull Name
run()37501TestTokenizer.run()
checkWrongPrintfScanfArguments()349414CheckIO.checkWrongPrintfScanfArguments()
SymbolDatabase(constTokenizer*,constSettings*,ErrorLogger*)279519SymbolDatabase.SymbolDatabase(constTokenizer*,constSettings* ,ErrorLogger*)
simplifyTypedef()197410Tokenizer.simplifyTypedef()
getcode(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool ,unsignedint)19139CheckMemoryLeakInFunction.getcode(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool,unsignedint)
run()18101TestPreprocessor.run()
run()17002TestSimplifyTokens.run()
run()15603TestMemleakInFunction.run()
load(consttinyxml2::XMLDocument&)14848Library.load(consttinyxml2::XMLDocument&)
run()14401TestSymbolDatabase.run()
run()13701TestBufferOverrun.run()
run()13701TestClass.run()
ParseFromArgs(int,constchar*const*)13026CmdLineParser.ParseFromArgs(int,constchar*const*)
ParseFromArgs(int,constchar*const*)13026CmdLineParser.ParseFromArgs(int,constchar*const*)
run()12701TestVarID.run()
simplifycode(Token*)12447CheckMemoryLeakInFunction.simplifycode(Token*)
parse(constToken&,std::list<ExecutionPath*>&)12227UninitVar.parse(constToken&,std::list<ExecutionPath*>&)
run()12101TestSimplifyTypedef.run()
checkFunctionVariableUsage_iterateScopes(constScope*const,Variables& ,bool)11927CheckUnusedVar.checkFunctionVariableUsage_iterateScopes (constScope*const,Variables&,bool)
run()11901TestConstructors.run()
run()11901TestUnusedVar.run()
simplifyEnum()111411Tokenizer.simplifyEnum()
run()10301TestOther.run()
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)9837__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
setVarId()9639Tokenizer.setVarId()
getcfgs(conststd::string&,conststd::string&,conststd::map<std::string ,std::string>&)9636Preprocessor.getcfgs(conststd::string&,conststd::string&,conststd::map <std::string,std::string>&)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)9226Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)
run()9001TestCmdlineParser.run()
checkScopeForVariable(constToken*,constVariable&,bool*const,bool*const ,CheckUninitVar::Alloc*const,conststd::string&)8527CheckUninitVar.checkScopeForVariable(constToken*,constVariable& ,bool*const,bool*const,CheckUninitVar::Alloc*const,conststd::string&)
checkScope(constToken*const,VarInfo*,std::set<unsignedint>)8227CheckLeakAutoVar.checkScope(constToken*const,VarInfo*,std::set <unsignedint>)
valueFlowBeforeCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)8147__Globals.valueFlowBeforeCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
checkScope(constToken*,std::list<ExecutionPath*>&)81210ExecutionPath.checkScope(constToken*,std::list<ExecutionPath*>&)
simplifyVarDecl(Token*,Token*,bool)8037Tokenizer.simplifyVarDecl(Token*,Token*,bool)
run()7901TestStl.run()
checkFileUsage()7039CheckIO.checkFileUsage()
simplifyMicrosoftStringFunctions()7025Tokenizer.simplifyMicrosoftStringFunctions()
initializeVarList(constFunction&,std::list<constFunction*>& ,constScope*,std::vector<Usage>&)6427CheckClass.initializeVarList(constFunction&,std::list<constFunction*>& ,constScope*,std::vector<Usage>&)
simplifyKnownVariables()6337Tokenizer.simplifyKnownVariables()
removeComments(conststd::string&,conststd::string&)63210Preprocessor.removeComments(conststd::string&,conststd::string&)
run()6301TestSimplifyTemplate.run()
checkScope(constToken*,conststd::vector<std::string>& ,constCheckBufferOverrun::ArrayInfo&)5728CheckBufferOverrun.checkScope(constToken*,conststd::vector<std::string >&,constCheckBufferOverrun::ArrayInfo&)
expandMacros(conststd::string&,std::string,conststd::string& ,ErrorLogger*)5649Preprocessor.expandMacros(conststd::string&,std::string ,conststd::string&,ErrorLogger*)
isVariableUsage(constToken*,bool,CheckUninitVar::Alloc)5615CheckUninitVar.isVariableUsage(constToken*,bool,CheckUninitVar::Alloc)
run()5501TestLeakAutoVar.run()
eraseDeadCode(Token*,constToken*)5428Tokenizer.eraseDeadCode(Token*,constToken*)
simplifyTokenList1(constchar*)5325Tokenizer.simplifyTokenList1(constchar*)
valueFlowAfterCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)5248__Globals.valueFlowAfterCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
parseTokens(constTokenizer&,constchar*,constSettings*)5226CheckUnusedFunctions.parseTokens(constTokenizer&,constchar* ,constSettings*)
handleIncludes(conststd::string&,conststd::string&,conststd::list <std::string>&,std::map<std::string,std::string>&,std::set<std::string >&,std::list<std::string>)5126Preprocessor.handleIncludes(conststd::string&,conststd::string& ,conststd::list<std::string>&,std::map<std::string,std::string>& ,std::set<std::string>&,std::list<std::string>)
getcode(conststd::string&,conststd::string&,conststd::string&)5027Preprocessor.getcode(conststd::string&,conststd::string& ,conststd::string&)
printOut(constchar*)4734SymbolDatabase.printOut(constchar*)
simplifyCalculations(Token*)4726TemplateSimplifier.simplifyCalculations(Token*)
run()4702TestNullPointer.run()
run()4701TestGarbage.run()
string_c_str()4647CheckStl.string_c_str()
checkRedundantAssignment()4639CheckOther.checkRedundantAssignment()
simplifyMathFunctions()4626Tokenizer.simplifyMathFunctions()
constructors()4547CheckClass.constructors()
setTokenValue(Token*,constValueFlow::Value&)4537__Globals.setTokenValue(Token*,constValueFlow::Value&)
doAssignment(Variables&,constToken*,bool,constScope*)45110__Globals.doAssignment(Variables&,constToken*,bool,constScope*)
run()4501TestToken.run()
simplifyTemplateInstantiations(TokenList&,ErrorLogger*,constSettings* ,constToken*,std::list<Token*>&,std::set<std::string>&)4438TemplateSimplifier.simplifyTemplateInstantiations(TokenList& ,ErrorLogger*,constSettings*,constToken*,std::list<Token*>&,std::set <std::string>&)
checkStructVariable(constVariable*const)4437CheckMemoryLeakStructMember.checkStructVariable(constVariable*const)
call_func(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool& ,unsignedint)4424CheckMemoryLeakInFunction.call_func(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool&,unsignedint)
argsMatch(constScope*,constToken*,constToken*,conststd::string& ,unsignedint)4325Function.argsMatch(constScope*,constToken*,constToken* ,conststd::string&,unsignedint)
simplifyMathExpressions()4315Tokenizer.simplifyMathExpressions()
simplifyCondition(conststd::map<std::string,std::string>&,std::string& ,bool)4226Preprocessor.simplifyCondition(conststd::map<std::string,std::string>& ,std::string&,bool)
simplifySizeof()4127Tokenizer.simplifySizeof()
run()4101TestAutoVariables.run()
checkConstFunc(constScope*,constFunction*,bool&)4026CheckClass.checkConstFunc(constScope*,constFunction*,bool&)
getVariableList(constLibrary*)4024Scope.getVariableList(constLibrary*)
execute(constToken*,std::map<unsignedint,MathLib::bigint>*const ,MathLib::bigint*,bool*)4004__Globals.execute(constToken*,std::map<unsignedint,MathLib::bigint >*const,MathLib::bigint*,bool*)
duplicateTypedef(Token**,constToken*,constToken*,conststd::set <std::string>&)3918Tokenizer.duplicateTypedef(Token**,constToken*,constToken* ,conststd::set<std::string>&)
isFloat(conststd::string&)3913MathLib.isFloat(conststd::string&)
checkStructVariable()38611CheckBufferOverrun.checkStructVariable()
checkScope(constToken*,constCheckBufferOverrun::ArrayInfo&)3829CheckBufferOverrun.checkScope(constToken* ,constCheckBufferOverrun::ArrayInfo&)
run()3801TestUninitVar.run()
useDefaultArgumentValues(conststd::list<Token*>&,std::list<Token*>*)3747TemplateSimplifier.useDefaultArgumentValues(conststd::list<Token*>& ,std::list<Token*>*)
checkIncorrectLogicOperator()3736CheckCondition.checkIncorrectLogicOperator()
multiComparePercent(constToken*,constchar*&,bool,unsignedint)3705__Globals.multiComparePercent(constToken*,constchar*&,bool,unsignedint )
templateParameters(constToken*)3634TemplateSimplifier.templateParameters(constToken*)
code(conststd::vector<std::string>&,conststd::map<std::string ,PreprocessorMacro*>&,std::string&)3539PreprocessorMacro.code(conststd::vector<std::string>&,conststd::map <std::string,PreprocessorMacro*>&,std::string&)
simplifyFunctionParameters()3537Tokenizer.simplifyFunctionParameters()
createTokens(std::istream&,conststd::string&)3528TokenList.createTokens(std::istream&,conststd::string&)
findFunction(constToken*)3528Scope.findFunction(constToken*)
ArgumentInfo(constToken*,constSettings*)3528CheckIO+ArgumentInfo.ArgumentInfo(constToken*,constSettings*)
simplifyConditions()3525Tokenizer.simplifyConditions()
hasComplicatedSyntaxErrorsInTemplates(Token*)3436TemplateSimplifier.hasComplicatedSyntaxErrorsInTemplates(Token*)
simplifyTokenList2()3425Tokenizer.simplifyTokenList2()
iterators()3425CheckStl.iterators()
simplifyPlatformTypes()3415Tokenizer.simplifyPlatformTypes()
virtualDestructor()3338CheckClass.virtualDestructor()
pushback()3336CheckStl.pushback()
addClassFunction(Scope**,constToken**,constToken*)3329SymbolDatabase.addClassFunction(Scope**,constToken**,constToken*)
countSprintfLength(conststd::string&,conststd::list<constToken*>&)3315CheckBufferOverrun.countSprintfLength(conststd::string&,conststd::list <constToken*>&)
expandTemplate(TokenList&,constToken*,conststd::string&,std::vector <constToken*>&,conststd::string&,std::vector<constToken*>&,std::list <Token*>&)3237TemplateSimplifier.expandTemplate(TokenList&,constToken* ,conststd::string&,std::vector<constToken*>&,conststd::string& ,std::vector<constToken*>&,std::list<Token*>&)
addArguments(constSymbolDatabase*,constScope*)3138Function.addArguments(constSymbolDatabase*,constScope*)
simplifyRedundantParentheses()3135Tokenizer.simplifyRedundantParentheses()
simplifyStructDecl()3127Tokenizer.simplifyStructDecl()
removeUnnecessaryQualification()3127Tokenizer.removeUnnecessaryQualification()

Statistics

Stat   Cyclomatic Complexity (CC)   MaxNestedLoop   NestingDepth
Sum:10 5854791 950
Average:361.636.63
Minimum:101
Maximum:375631
Standard deviation:46.731.323.9
Variance:2 1841.7315.21
warningCritical    Rule warning: Methods potentially poorly commented
• Rule Description:

This rule matches methods with less than 20% of comment lines and that have at least 20 lines of code. Such method might need to be more commented.

See the definitions of the Comments metric here: http://www.cppdepend.com/Metrics.aspx#PercentageComment http://www.cppdepend.com/Metrics.aspx#NbLinesOfComment


• How to Fix Violations:

Typically add more comment. But code commenting is subject to controversy. While poorly written and designed code would needs a lot of comment to be understood, clean code doesn't need that much comment, especially if variables and methods are properly named and convey enough information. Unit-Test code can also play the role of code commenting.

However, even when writing clean and well-tested code, one will have to write hacks at a point, usually to circumvent some API limitations or bugs. A hack is a non-trivial piece of code, that doesn't make sense at first glance, and that took time and web research to be found. In such situation comments must absolutely be used to express the intention, the need for the hacks and the source where the solution has been found.

382 methods matched

methodsPercentage Comment# lines of code (LOC)# lines of commentFull Name
printfFormatType(std::ostream&,conststd::string&,bool)0290__Globals.printfFormatType(std::ostream&,conststd::string&,bool)
toxml(conststd::string&)0270__Globals.toxml(conststd::string&)
execute(constToken*,std::map<unsignedint,MathLib::bigint>*const ,MathLib::bigint*,bool*)01051__Globals.execute(constToken*,std::map<unsignedint,MathLib::bigint >*const,MathLib::bigint*,bool*)
valueFlowForLoop(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)0260__Globals.valueFlowForLoop(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)
isFloat(conststd::string&)0900MathLib.isFloat(conststd::string&)
isDec(conststd::string&)0240MathLib.isDec(conststd::string&)
isHex(conststd::string&)0360MathLib.isHex(conststd::string&)
printValueFlow(bool,std::ostream&)0380Token.printValueFlow(bool,std::ostream&)
deserialize(conststd::string&)0470ErrorLogger+ErrorMessage.deserialize(conststd::string&)
unsupportedTypedef(constToken*)0210Tokenizer.unsupportedTypedef(constToken*)
isScopeNoReturn(constToken*,std::string*)0220Library.isScopeNoReturn(constToken*,std::string*)
printOut(constchar*)01291SymbolDatabase.printOut(constchar*)
printVariable(constVariable*,constchar*)0340SymbolDatabase.printVariable(constVariable*,constchar*)
arrayIndexOutOfBoundsError(constToken* ,constCheckBufferOverrun::ArrayInfo&,conststd::vector<ValueFlow::Value >&)0250CheckBufferOverrun.arrayIndexOutOfBoundsError(constToken* ,constCheckBufferOverrun::ArrayInfo&,conststd::vector<ValueFlow::Value >&)
invalidScanfArgTypeError_int(constToken*,unsignedint,conststd::string& ,constCheckIO::ArgumentInfo*,bool)0400CheckIO.invalidScanfArgTypeError_int(constToken*,unsignedint ,conststd::string&,constCheckIO::ArgumentInfo*,bool)
argumentType(std::ostream&,constCheckIO::ArgumentInfo*)0410CheckIO.argumentType(std::ostream&,constCheckIO::ArgumentInfo*)
getErrorMessages(ErrorLogger*,constSettings*)0240CheckIO.getErrorMessages(ErrorLogger*,constSettings*)
checkIfForWhileHead(constToken*,constVariable&,bool,bool ,CheckUninitVar::Alloc,conststd::string&)0220CheckUninitVar.checkIfForWhileHead(constToken*,constVariable&,bool ,bool,CheckUninitVar::Alloc,conststd::string&)
getErrorMessages(ErrorLogger*,constSettings*)0280CheckStl.getErrorMessages(ErrorLogger*,constSettings*)
tooManyConfigsError(conststd::string&,conststd::size_t)0210CppCheck.tooManyConfigsError(conststd::string&,conststd::size_t)
check()0390ThreadExecutor.check()
check()0390ThreadExecutor.check()
comparisonOfBoolExpressionWithInt2()0280TestBool.comparisonOfBoolExpressionWithInt2()
countSprintfLength()0700TestBufferOverrun.countSprintfLength()
constassign2()0280TestClass.constassign2()
relativePaths()0250TestCmdlineParser.relativePaths()
enforceLanguage()0230TestCmdlineParser.enforceLanguage()
checkBadBitmaskCheck()0240TestCondition.checkBadBitmaskCheck()
testMicrosoftSecureScanfArgument()0260TestIO.testMicrosoftSecureScanfArgument()
run()0260TestMathLib.run()
assign1()0220TestMemleakInFunction.assign1()
switchRedundantOperationTest()0480TestOther.switchRedundantOperationTest()
switchRedundantBitwiseOperationTest()0240TestOther.switchRedundantBitwiseOperationTest()
suspiciousEqualityComparison()0320TestOther.suspiciousEqualityComparison()
checkSignOfPointer()0620TestOther.checkSignOfPointer()
checkInvalidFree()0220TestOther.checkInvalidFree()
run()0270TestPathMatch.run()
match_cfg_def()0220TestPreprocessor.match_cfg_def()
macroInMacro1()0260TestPreprocessor.macroInMacro1()
iftruefalse()0350TestSimplifyTokens.iftruefalse()
sizeof18()0500TestSimplifyTokens.sizeof18()
simplifyStructDecl3()0600TestSimplifyTokens.simplifyStructDecl3()
incorrectStringCompare()0300TestString.incorrectStringCompare()
test_isVariableDeclarationIdentifiesPointers()0280TestSymbolDatabase.test_isVariableDeclarationIdentifiesPointers()
isVariableDeclarationIdentifiesReference()0240TestSymbolDatabase.isVariableDeclarationIdentifiesReference()
isVariableStlType()0380TestSymbolDatabase.isVariableStlType()
symboldatabase31()0210TestSymbolDatabase.symboldatabase31()
symboldatabase37()0210TestSymbolDatabase.symboldatabase37()
findFunction4()0590TestSymbolDatabase.findFunction4()
varTypesIntegral()0670TestSymbolDatabase.varTypesIntegral()
varTypesFloating()0420TestSymbolDatabase.varTypesFloating()
matchNumeric()0340TestToken.matchNumeric()
initOps()0380TestToken.initOps()
operators()0220TestToken.operators()
syntax_error()0570TestTokenizer.syntax_error()
bitfields1()0500TestTokenizer.bitfields1()
microsoftMemory()0300TestTokenizer.microsoftMemory()
localvar8()0570TestUnusedVar.localvar8()
localvarStruct5()0320TestUnusedVar.localvarStruct5()
localvardynamic1()0300TestUnusedVar.localvardynamic1()
localvardynamic2()0280TestUnusedVar.localvardynamic2()
run()0240TestValueFlow.run()
createAstAtToken(Token*,bool)1691__Globals.createAstAtToken(Token*,bool)
load(consttinyxml2::XMLDocument&)13776Library.load(consttinyxml2::XMLDocument&)
comparisonOfBoolExpressionWithInt1()1651TestBool.comparisonOfBoolExpressionWithInt1()
const14()1521TestClass.const14()
isfloat()1971TestMathLib.isfloat()
checkSignOfUnsignedVariable()1571TestOther.checkSignOfUnsignedVariable()
checkPointerSizeof()1621TestSizeof.checkPointerSizeof()
simplifyKnownVariables29()1561TestTokenizer.simplifyKnownVariables29()
compileTerm(Token*&,AST_state&)2341__Globals.compileTerm(Token*&,AST_state&)
valueFlowForLoop1(constToken*,unsignedint*const,MathLib::bigint*const ,MathLib::bigint*const,MathLib::bigint*const)2331__Globals.valueFlowForLoop1(constToken*,unsignedint*const ,MathLib::bigint*const,MathLib::bigint*const,MathLib::bigint*const)
simplifyDoublePlusAndDoubleMinus()2331Tokenizer.simplifyDoublePlusAndDoubleMinus()
operatorEqToSelf5()2341TestClass.operatorEqToSelf5()
testScanfArgument()21855TestIO.testScanfArgument()
testMicrosoftSecurePrintfArgument()2361TestIO.testMicrosoftSecurePrintfArgument()
doublefree1()2802TestLeakAutoVar.doublefree1()
container()2391TestLibrary.container()
simplifyStructDecl1()2692TestSimplifyTokens.simplifyStructDecl1()
noexceptFunction3()2331TestSymbolDatabase.noexceptFunction3()
simplifyInitVar()2902TestTokenizer.simplifyInitVar()
astGetSizeSign(constSettings*,constToken*,unsignedint*,char*)3532__Globals.astGetSizeSign(constSettings*,constToken*,unsignedint*,char* )
compilePrecedence3(Token*&,AST_state&)3592__Globals.compilePrecedence3(Token*&,AST_state&)
Settings()3261Settings.Settings()
printXml(std::ostream&)3592SymbolDatabase.printXml(std::ostream&)
checkComparisonOfFuncReturningBool()3251CheckBool.checkComparisonOfFuncReturningBool()
getErrorMessages(ErrorLogger*,constSettings*)3271CheckClass.getErrorMessages(ErrorLogger*,constSettings*)
checkFileUsage()31776CheckIO.checkFileUsage()
checkLoopBody(constToken*,constVariable&,constCheckUninitVar::Alloc ,conststd::string&,constbool)3582CheckUninitVar.checkLoopBody(constToken*,constVariable& ,constCheckUninitVar::Alloc,conststd::string&,constbool)
filterException(int,PEXCEPTION_POINTERS)3763__Globals.filterException(int,PEXCEPTION_POINTERS)
filterException(int,PEXCEPTION_POINTERS)3763__Globals.filterException(int,PEXCEPTION_POINTERS)
runTests(constoptions&)3301TestFixture.runTests(constoptions&)
array_index_multidim()3281TestBufferOverrun.array_index_multidim()
cmdLineArgs1()3261TestBufferOverrun.cmdLineArgs1()
incorrectLogicOperator1()3261TestCondition.incorrectLogicOperator1()
printf_with_invalid_va_argument()3261TestNullPointer.printf_with_invalid_va_argument()
functionArgs1()3281TestSymbolDatabase.functionArgs1()
throwFunction2()3311TestSymbolDatabase.throwFunction2()
pointers_condition()3301TestTokenizer.pointers_condition()
simplifyMicrosoftStringFunctions()41115Tokenizer.simplifyMicrosoftStringFunctions()

Statistics

Stat   Percentage Comment   # lines of code (LOC)   # lines of comment
Sum:3 44922 3982 699
Average:9.0358.637.07
Minimum:0210
Maximum:19691107
Standard deviation:6.0969.3111.34
Variance:37.114 803128.7
warningCritical    Rule warning: Methods with too many parameters
• Rule Description:

This rule matches methods with more than 5 parameters. Such method might be painful to call and might degrade performance. See the definition of the NbParameters metric here: http://www.cppdepend.com/Metrics.aspx#NbParameters


• How to Fix Violations:

More properties/fields can be added to the declaring type to handle numerous states. An alternative is to provide a class or a structure dedicated to handle arguments passing.

28 methods matched

methods# ParametersFull Name
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)9__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)9Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)
Variable(constToken*,constToken*,constToken*,std::size_t,AccessControl ,constType*,constScope*,constLibrary*)8Variable.Variable(constToken*,constToken*,constToken*,std::size_t ,AccessControl,constType*,constScope*,constLibrary*)
stringifyList(bool,bool,bool,bool,bool,conststd::vector<std::string>* ,constToken*)7Token.stringifyList(bool,bool,bool,bool,bool,conststd::vector <std::string>*,constToken*)
simplifyKnownVariablesGetData(unsignedint,Token**,Token**,std::string& ,unsignedint&,bool&,bool)7Tokenizer.simplifyKnownVariablesGetData(unsignedint,Token**,Token** ,std::string&,unsignedint&,bool&,bool)
addVariable(constToken*,constToken*,constToken*,AccessControl ,constType*,constScope*,constLibrary*)7Scope.addVariable(constToken*,constToken*,constToken*,AccessControl ,constType*,constScope*,constLibrary*)
duplInheritedMembersError(constToken*,constToken*,conststd::string& ,conststd::string&,conststd::string&,bool,bool)7CheckClass.duplInheritedMembersError(constToken*,constToken* ,conststd::string&,conststd::string&,conststd::string&,bool,bool)
call_func(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool& ,unsignedint)7CheckMemoryLeakInFunction.call_func(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool&,unsignedint)
getcode(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool ,unsignedint)7CheckMemoryLeakInFunction.getcode(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool,unsignedint)
expandTemplate(TokenList&,constToken*,conststd::string&,std::vector <constToken*>&,conststd::string&,std::vector<constToken*>&,std::list <Token*>&)7TemplateSimplifier.expandTemplate(TokenList&,constToken* ,conststd::string&,std::vector<constToken*>&,conststd::string& ,std::vector<constToken*>&,std::list<Token*>&)
check(constchar*,constchar*,bool,bool,bool,Settings*,bool)7TestOther.check(constchar*,constchar*,bool,bool,bool,Settings*,bool)
setVarIdClassFunction(conststd::string&,Token*const,constToken*const ,conststd::map<std::string,unsignedint>&,std::map<unsignedint,std::map <std::string,unsignedint>>*,unsignedint*)6__Globals.setVarIdClassFunction(conststd::string&,Token*const ,constToken*const,conststd::map<std::string,unsignedint>&,std::map <unsignedint,std::map<std::string,unsignedint>>*,unsignedint*)
linkBrackets(Tokenizer*,std::stack<constToken*>&,std::stack<Token*>& ,Token*,char,char)6__Globals.linkBrackets(Tokenizer*,std::stack<constToken*>&,std::stack <Token*>&,Token*,char,char)
valueFlowForLoopSimplify(Token*const,constunsignedint ,constMathLib::bigint,TokenList*,ErrorLogger*,constSettings*)6__Globals.valueFlowForLoopSimplify(Token*const,constunsignedint ,constMathLib::bigint,TokenList*,ErrorLogger*,constSettings*)
valueFlowForLoopSimplifyAfter(Token*,unsignedint,constMathLib::bigint ,TokenList*,ErrorLogger*,constSettings*)6__Globals.valueFlowForLoopSimplifyAfter(Token*,unsignedint ,constMathLib::bigint,TokenList*,ErrorLogger*,constSettings*)
valueFlowInjectParameter(TokenList*,ErrorLogger*,constSettings* ,constVariable*,constScope*,conststd::list<ValueFlow::Value>&)6__Globals.valueFlowInjectParameter(TokenList*,ErrorLogger* ,constSettings*,constVariable*,constScope*,conststd::list <ValueFlow::Value>&)
ErrorMessage(conststd::list<constToken*>&,constTokenList* ,Severity::SeverityType,conststd::string&,conststd::string&,bool)6ErrorLogger+ErrorMessage.ErrorMessage(conststd::list<constToken*>& ,constTokenList*,Severity::SeverityType,conststd::string& ,conststd::string&,bool)
reportError<T,U>(constToken*,constSeverity::SeverityType,constT,constU ,unsignedint,bool)6Check.reportError<T,U>(constToken*,constSeverity::SeverityType,constT ,constU,unsignedint,bool)
reportError<T,U>(conststd::list<constToken*>&,Severity::SeverityType ,constT,constU,unsignedint,bool)6Check.reportError<T,U>(conststd::list<constToken*>& ,Severity::SeverityType,constT,constU,unsignedint,bool)
assignIfParseScope(constToken*const,constToken*const,constunsignedint ,constbool,constchar,constMathLib::bigint)6CheckCondition.assignIfParseScope(constToken*const,constToken*const ,constunsignedint,constbool,constchar,constMathLib::bigint)
comparisonError(constToken*,conststd::string&,MathLib::bigint ,conststd::string&,MathLib::bigint,bool)6CheckCondition.comparisonError(constToken*,conststd::string& ,MathLib::bigint,conststd::string&,MathLib::bigint,bool)
checkScopeForVariable(constToken*,constVariable&,bool*const,bool*const ,CheckUninitVar::Alloc*const,conststd::string&)6CheckUninitVar.checkScopeForVariable(constToken*,constVariable& ,bool*const,bool*const,CheckUninitVar::Alloc*const,conststd::string&)
checkIfForWhileHead(constToken*,constVariable&,bool,bool ,CheckUninitVar::Alloc,conststd::string&)6CheckUninitVar.checkIfForWhileHead(constToken*,constVariable&,bool ,bool,CheckUninitVar::Alloc,conststd::string&)
VariableUsage(constVariable*,Variables::VariableType,bool,bool,bool ,bool)6Variables+VariableUsage.VariableUsage(constVariable* ,Variables::VariableType,bool,bool,bool,bool)
handleIncludes(conststd::string&,conststd::string&,conststd::list <std::string>&,std::map<std::string,std::string>&,std::set<std::string >&,std::list<std::string>)6Preprocessor.handleIncludes(conststd::string&,conststd::string& ,conststd::list<std::string>&,std::map<std::string,std::string>& ,std::set<std::string>&,std::list<std::string>)
simplifyTemplateInstantiations(TokenList&,ErrorLogger*,constSettings* ,constToken*,std::list<Token*>&,std::set<std::string>&)6TemplateSimplifier.simplifyTemplateInstantiations(TokenList& ,ErrorLogger*,constSettings*,constToken*,std::list<Token*>&,std::set <std::string>&)
tokenizeAndStringify(constchar*,bool,bool,Settings::PlatformType ,constchar*,bool)6TestTokenizer.tokenizeAndStringify(constchar*,bool,bool ,Settings::PlatformType,constchar*,bool)
tokenizeAndStringifyWindows(constchar*,bool,bool ,Settings::PlatformType,constchar*,bool)6TestTokenizer.tokenizeAndStringifyWindows(constchar*,bool,bool ,Settings::PlatformType,constchar*,bool)

Statistics

Stat   # Parameters
Sum:184
Average:6.57
Minimum:6
Maximum:9
Standard deviation:0.86
Variance:0.74
warningCritical    Rule warning: Methods with too many local variables
• Rule Description:

This rule matches methods with more than 15 variables.

Methods where NbVariables > 8 are hard to understand and maintain. Methods where NbVariables > 15 are extremely complex and must be refactored.

See the definition of the Nbvariables metric here: http://www.cppdepend.com/Metrics.aspx#Nbvariables


• How to Fix Violations:

To refactor such method and increase code quality and maintainability, certainly you'll have to split the method into several smaller methods or even create one or several classes to implement the logic.

During this process it is important to question the scope of each variable local to the method. This can be an indication if such local variable will become an instance field of the newly created class(es).

82 methods matched

methods# VariablesFull Name
SymbolDatabase(constTokenizer*,constSettings*,ErrorLogger*)108SymbolDatabase.SymbolDatabase(constTokenizer*,constSettings* ,ErrorLogger*)
load(consttinyxml2::XMLDocument&)94Library.load(consttinyxml2::XMLDocument&)
simplifyTypedef()79Tokenizer.simplifyTypedef()
getcfgs(conststd::string&,conststd::string&,conststd::map<std::string ,std::string>&)61Preprocessor.getcfgs(conststd::string&,conststd::string&,conststd::map <std::string,std::string>&)
simplifyEnum()57Tokenizer.simplifyEnum()
createLinks()55TestTokenizer.createLinks()
simplifyStdType()48TestTokenizer.simplifyStdType()
ParseFromArgs(int,constchar*const*)46CmdLineParser.ParseFromArgs(int,constchar*const*)
ParseFromArgs(int,constchar*const*)46CmdLineParser.ParseFromArgs(int,constchar*const*)
simplifyStructDecl1()46TestSimplifyTokens.simplifyStructDecl1()
testScanfArgument()45TestIO.testScanfArgument()
simplifyMathFunctions()42Tokenizer.simplifyMathFunctions()
getcode(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool ,unsignedint)40CheckMemoryLeakInFunction.getcode(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool,unsignedint)
simplifyStructDecl3()40TestSimplifyTokens.simplifyStructDecl3()
simplifyTypedefFunction1()40TestSimplifyTypedef.simplifyTypedefFunction1()
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)39__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
removeComments(conststd::string&,conststd::string&)39Preprocessor.removeComments(conststd::string&,conststd::string&)
def_handleIncludes()39TestPreprocessor.def_handleIncludes()
simplifyKnownVariables()38Tokenizer.simplifyKnownVariables()
simplifyKnownVariables29()38TestTokenizer.simplifyKnownVariables29()
parse(constToken&,std::list<ExecutionPath*>&)37UninitVar.parse(constToken&,std::list<ExecutionPath*>&)
checkFunctionVariableUsage_iterateScopes(constScope*const,Variables& ,bool)37CheckUnusedVar.checkFunctionVariableUsage_iterateScopes (constScope*const,Variables&,bool)
setVarId()36Tokenizer.setVarId()
checkWrongPrintfScanfArguments()36CheckIO.checkWrongPrintfScanfArguments()
expandMacros(conststd::string&,std::string,conststd::string& ,ErrorLogger*)36Preprocessor.expandMacros(conststd::string&,std::string ,conststd::string&,ErrorLogger*)
checkIncorrectLogicOperator()35CheckCondition.checkIncorrectLogicOperator()
checkScope(constToken*,conststd::vector<std::string>& ,constCheckBufferOverrun::ArrayInfo&)33CheckBufferOverrun.checkScope(constToken*,conststd::vector<std::string >&,constCheckBufferOverrun::ArrayInfo&)
syntax_error()32TestTokenizer.syntax_error()
checkFileUsage()30CheckIO.checkFileUsage()
simplifyInitVar()30TestTokenizer.simplifyInitVar()
flowControl()29TestSimplifyTokens.flowControl()
checkScopeForVariable(constToken*,constVariable&,bool*const,bool*const ,CheckUninitVar::Alloc*const,conststd::string&)28CheckUninitVar.checkScopeForVariable(constToken*,constVariable& ,bool*const,bool*const,CheckUninitVar::Alloc*const,conststd::string&)
string_c_str()28CheckStl.string_c_str()
simplifyTemplateInstantiations(TokenList&,ErrorLogger*,constSettings* ,constToken*,std::list<Token*>&,std::set<std::string>&)26TemplateSimplifier.simplifyTemplateInstantiations(TokenList& ,ErrorLogger*,constSettings*,constToken*,std::list<Token*>&,std::set <std::string>&)
checkRedundantAssignment()25CheckOther.checkRedundantAssignment()
checkScope(constToken*const,VarInfo*,std::set<unsignedint>)25CheckLeakAutoVar.checkScope(constToken*const,VarInfo*,std::set <unsignedint>)
parseTokens(constTokenizer&,constchar*,constSettings*)25CheckUnusedFunctions.parseTokens(constTokenizer&,constchar* ,constSettings*)
getcode(conststd::string&,conststd::string&,conststd::string&)25Preprocessor.getcode(conststd::string&,conststd::string& ,conststd::string&)
if_cond4()25TestPreprocessor.if_cond4()
define_ifdef()25TestPreprocessor.define_ifdef()
bitfields1()25TestTokenizer.bitfields1()
virtualDestructor()24CheckClass.virtualDestructor()
syntax_error_templates_1()24TestTokenizer.syntax_error_templates_1()
valueFlowBeforeCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)23__Globals.valueFlowBeforeCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
valueFlowAfterCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)23__Globals.valueFlowAfterCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)23Tokenizer.simplifyKnownVariablesSimplify(Token**,Token*,unsignedint ,conststd::string&,std::string&,unsignedint,bool,constToken*const,int)
pushback()23CheckStl.pushback()
iftruefalse()23TestSimplifyTokens.iftruefalse()
sizeof9()23TestSimplifyTokens.sizeof9()
checkStructVariable()22CheckBufferOverrun.checkStructVariable()
checkScope(constToken*,constCheckBufferOverrun::ArrayInfo&)22CheckBufferOverrun.checkScope(constToken* ,constCheckBufferOverrun::ArrayInfo&)
checkFile(conststd::string&,constchar*,std::set<unsignedlonglong>&)22CppCheck.checkFile(conststd::string&,constchar*,std::set <unsignedlonglong>&)
handleIncludes(conststd::string&,conststd::string&,conststd::list <std::string>&,std::map<std::string,std::string>&,std::set<std::string >&,std::list<std::string>)22Preprocessor.handleIncludes(conststd::string&,conststd::string& ,conststd::list<std::string>&,std::map<std::string,std::string>& ,std::set<std::string>&,std::list<std::string>)
utf16()22TestPreprocessor.utf16()
simplifyMathExpressions()21Tokenizer.simplifyMathExpressions()
checkGlobalAndLocalVariable()21CheckBufferOverrun.checkGlobalAndLocalVariable()
simplifycode(Token*)21CheckMemoryLeakInFunction.simplifycode(Token*)
handleIncludes(std::string&,conststd::string&,conststd::list <std::string>&)21Preprocessor.handleIncludes(std::string&,conststd::string& ,conststd::list<std::string>&)
check_internal(CppCheck&,int,constchar*const*)21CppCheckExecutor.check_internal(CppCheck&,int,constchar*const*)
check_internal(CppCheck&,int,constchar*const*)21CppCheckExecutor.check_internal(CppCheck&,int,constchar*const*)
eraseDeadCode(Token*,constToken*)20Tokenizer.eraseDeadCode(Token*,constToken*)
constructors()20CheckClass.constructors()
call_func(constToken*,std::list<constToken*>,constunsignedint ,CheckMemoryLeak::AllocType&,CheckMemoryLeak::AllocType&,bool& ,unsignedint)20CheckMemoryLeakInFunction.call_func(constToken*,std::list<constToken*> ,constunsignedint,CheckMemoryLeak::AllocType& ,CheckMemoryLeak::AllocType&,bool&,unsignedint)
isVariableUsage(constToken*,bool,CheckUninitVar::Alloc)20CheckUninitVar.isVariableUsage(constToken*,bool,CheckUninitVar::Alloc)
mismatchingContainers()20CheckStl.mismatchingContainers()
useDefaultArgumentValues(conststd::list<Token*>&,std::list<Token*>*)20TemplateSimplifier.useDefaultArgumentValues(conststd::list<Token*>& ,std::list<Token*>*)
functioncalllibrary()20TestNullPointer.functioncalllibrary()
variable(constScope*,constToken*)19CheckMemoryLeakInClass.variable(constScope*,constToken*)
checkScope(constToken*,std::list<ExecutionPath*>&)19ExecutionPath.checkScope(constToken*,std::list<ExecutionPath*>&)
processFile(conststd::string&,std::istream&)19CppCheck.processFile(conststd::string&,std::istream&)
checkFunctionParameter(constToken&,constunsignedint ,constCheckBufferOverrun::ArrayInfo&,conststd::list<constToken*>&)18CheckBufferOverrun.checkFunctionParameter(constToken&,constunsignedint ,constCheckBufferOverrun::ArrayInfo&,conststd::list<constToken*>&)
sizeof18()18TestSimplifyTokens.sizeof18()
simplifySizeof()17Tokenizer.simplifySizeof()
addClassFunction(Scope**,constToken**,constToken*)17SymbolDatabase.addClassFunction(Scope**,constToken**,constToken*)
isVariableStlType()17TestSymbolDatabase.isVariableStlType()
matchNumeric()17TestToken.matchNumeric()
simplifyNamespaceStd()17TestTokenizer.simplifyNamespaceStd()
simplifyTokenList1(constchar*)16Tokenizer.simplifyTokenList1(constchar*)
simplifyVarDecl(Token*,Token*,bool)16Tokenizer.simplifyVarDecl(Token*,Token*,bool)
valueFlowCheckArrayIndex(constToken*const ,constCheckBufferOverrun::ArrayInfo&)16CheckBufferOverrun.valueFlowCheckArrayIndex(constToken*const ,constCheckBufferOverrun::ArrayInfo&)
oppositeInnerCondition()16CheckCondition.oppositeInnerCondition()
enum15()16TestSimplifyTokens.enum15()

Statistics

Stat   # Variables
Sum:2 488
Average:30.34
Minimum:16
Maximum:108
Standard deviation:16.31
Variance:265.98
warningCritical    Rule warning: Types with too many methods
• Rule Description:

This rule matches types with more than 20 methods. Such type might be hard to understand and maintain.

Notice that methods like constructors or property and event accessors are not taken account.

Having many methods for a type might be a symptom of too many responsibilities implemented.

Maybe you are facing the God Class phenomenon: A God Class is a class that controls way too many other classes in the system and has grown beyond all logic to become The Class That Does Everything.


• How to Fix Violations:

To refactor such type and increase code quality and maintainability, certainly you'll have to split the type into several smaller types that together, implement the same logic.

To refactor a God Class you'll need patience, and you might even need to recreate everything from scratch. Here are a few advices:

• Think before pulling out methods: What responsibility does it have? Can you isolate some subsets of methods that operate on the same subsets of fields?

• Try to maintain the interface of the god class at first and delegate calls to the new extracted classes. In the end the god class should be a pure facade without own logic. Then you can keep it for convenience or throw it away and start to use the new classes only.

• Unit Tests can help: write tests for each method before extracting it to ensure you don't break functionality.

65 types matched

typesInstanceMethodsStaticMethodsFull Name
TestTokenizer386 methods1 methodTestTokenizer
TestPreprocessor189 methods0 methodTestPreprocessor
TestSimplifyTokens182 methods0 methodTestSimplifyTokens
TestMemleakInFunction163 methods1 methodTestMemleakInFunction
TestClass156 methods0 methodTestClass
Tokenizer141 methods11 methodsTokenizer
TestSymbolDatabase149 methods2 methodsTestSymbolDatabase
TestBufferOverrun144 methods0 methodTestBufferOverrun
Token119 methods21 methodsToken
TestVarID132 methods0 methodTestVarID
TestSimplifyTypedef128 methods0 methodTestSimplifyTypedef
TestUnusedVar125 methods0 methodTestUnusedVar
TestConstructors124 methods0 methodTestConstructors
TestOther117 methods0 methodTestOther
CheckOther100 methods2 methodsCheckOther
TestCmdlineParser100 methods0 methodTestCmdlineParser
TestStl85 methods0 methodTestStl
TestSimplifyTemplate71 methods0 methodTestSimplifyTemplate
CheckClass61 methods9 methodsCheckClass
TestLeakAutoVar60 methods0 methodTestLeakAutoVar
Library49 methods3 methodsLibrary
Function51 methods1 methodFunction
XMLElement51 methods1 methodtinyxml2.XMLElement
TestGarbage52 methods0 methodTestGarbage
TestNullPointer52 methods0 methodTestNullPointer
TestToken51 methods1 methodTestToken
CheckStl49 methods1 methodCheckStl
XMLNode48 methods1 methodtinyxml2.XMLNode
TestAutoVariables46 methods0 methodTestAutoVariables
TestUninitVar46 methods0 methodTestUninitVar
Variable45 methods0 methodVariable
CheckBufferOverrun40 methods3 methodsCheckBufferOverrun
MathLib3 methods32 methodsMathLib
CheckIO33 methods2 methodsCheckIO
XMLPrinter35 methods0 methodtinyxml2.XMLPrinter
TestMemleakInClass35 methods0 methodTestMemleakInClass
TestUnusedPrivateFunction35 methods0 methodTestUnusedPrivateFunction
XMLDocument34 methods0 methodtinyxml2.XMLDocument
Preprocessor20 methods13 methodsPreprocessor
TestValueFlow33 methods0 methodTestValueFlow
TestPathMatch31 methods0 methodTestPathMatch
TestMathLib30 methods0 methodTestMathLib
CheckBool28 methods1 methodCheckBool
TestCondition29 methods0 methodTestCondition
TestBool28 methods0 methodTestBool
CheckAutoVariables21 methods6 methodsCheckAutoVariables
CheckCondition26 methods1 methodCheckCondition
CheckUninitVar25 methods2 methodsCheckUninitVar
TestUnusedFunctions27 methods0 methodTestUnusedFunctions
CheckSizeof25 methods1 methodCheckSizeof
CppCheck23 methods3 methodsCppCheck
TestIO26 methods0 methodTestIO
SymbolDatabase24 methods1 methodSymbolDatabase
TestErrorLogger25 methods0 methodTestErrorLogger
TestMemleakStructMember24 methods0 methodTestMemleakStructMember
Scope23 methods0 methodScope
UninitVar8 methods15 methodsUninitVar
Variables23 methods0 methodVariables
XMLAttribute23 methods0 methodtinyxml2.XMLAttribute
TestFixture22 methods1 methodTestFixture
TestIncompleteStatement23 methods0 methodTestIncompleteStatement
TokenList20 methods2 methodsTokenList
TestExceptionSafety22 methods0 methodTestExceptionSafety
CheckString20 methods1 methodCheckString
TestObsoleteFunctions21 methods0 methodTestObsoleteFunctions

Statistics

Stat   InstanceMethods   StaticMethods
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Rule warning: Types with too many fields
• Rule Description:

This rule matches types with more than 20 fields. Such type might be hard to understand and maintain.

Notice that constant fields and static-readonly fields are not counted. Enumerations types are not counted also.

Having many fields for a type might be a symptom of too many responsibilities implemented.


• How to Fix Violations:

To refactor such type and increase code quality and maintainability, certainly you'll have to group subsets of fields into smaller types and dispatch the logic implemented into the methods into these smaller types.

2 types matched

typesInstanceFieldsStaticFieldsFull Name
Settings51 fields0 fieldSettings
Library27 fields0 fieldLibrary

Statistics

Stat   InstanceFields   StaticFields
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Rule warning: Types with poor cohesion
• Rule Description:

This rule is based on the LCOM code metric, LCOM stands for Lack Of Cohesion of Methods. See the definition of the LCOM metric here http://www.cppdepend.com/Metrics.aspx#LCOM

The LCOM metric measures the fact that most methods are using most fields. A class is considered utterly cohesive (which is positive) if all its methods use all its instance fields.

Only types with enough methods and fields are taken account to avoid bias. The LCOM takes its values in the range [0-1].

This rule matches types with LCOM higher than 0.8. Such value generally pinpoints a poorly cohesive class.

There are several LCOM metrics. The LCOM HS (HS stands for Henderson-Sellers) takes its values in the range [0-2]. A LCOM HS value higher than 1 should be considered alarming.


• How to Fix Violations:

To refactor a poorly cohesive type and increase code quality and maintainability, certainly you'll have to split the type into several smaller and more cohesive types that together, implement the same logic.

8 types matched

typesLack of Cohesion Of Methods (LCOM)LCOM Henderson-Sellers (LCOMHS)# Methods# FieldsFull Name
Library0.950.975527Library
Function0.950.975515Function
Token0.940.9514317Token
Settings0.921.011751Settings
XMLDocument0.880.913612tinyxml2.XMLDocument
XMLPrinter0.870.93711tinyxml2.XMLPrinter
TestFixture0.860.92512TestFixture
Scope0.860.92718Scope

Statistics

Stat   Lack of Cohesion Of Methods (LCOM)   LCOM Henderson-Sellers (LCOMHS)   # Methods   # Fields
Sum:7.247.5395163
Average:0.90.9449.3820.38
Minimum:0.860.91711
Maximum:0.951.0114351
Standard deviation:0.0380.0437.5912.53
Variance:0.00140.00161 412156.98

240
Object Oriented Design  

warningCritical    Rule warning: Base class should not use derivatives
• Rule Description:

In Object-Oriented Programming, the open/closed principle states: software entities (components, classes, methods, etc.) should be open for extension, but closed for modification. http://en.wikipedia.org/wiki/Open/closed_principle

Hence a base class should be designed properly to make it easy to derive from, this is extension. But creating a new derived class, or modifying an existing one, shouldn't provoke any modification in the base class. And if a base class is using some derivative classes somehow, there are good chances that such modification will be needed.

Extending the base class is not anymore a simple operation, this is not good design.


• How to Fix Violations:

Understand the need for using derivatives, then imagine a new design, and then refactor.

Typically an algorithm in the base class needs to access something from derived classes. You can try to encapsulate this access behind an abstract or a virtual method.

If you see in the base class some conditions on typeof(DerivedClass) not only urgent refactoring is needed. Such condition can easily be replaced through an abstract or a virtual method.

Sometime you'll see a base class that creates instance of some derived classes. In such situation, certainly using the factory method pattern http://en.wikipedia.org/wiki/Factory_method_pattern or the abstract factory pattern http://en.wikipedia.org/wiki/Abstract_factory_pattern will improve the design.

1 types matched

typederivedClassesUsedFull Name
XMLNode6 typestinyxml2.XMLNode

Statistics

Stat   derivedClassesUsed
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Rule warning: Constructor should not call a virtual methods
// <Name>Constructor should not call a virtual methods</Name>

// Returns constructor of a non-sealed type calling virtual methods.
// In such a situation, if a derived class overrides the method,
// then the override method will be called before the derived constructor.
// This makes the class fragile to derive from.
//
// Violations reported can be solved by re-designing object initialisation
// or by marking the parent class as sealed, if possible.

warnif count > 0
from t in Application.Types where 
   
t.IsClass &&
  
!t.IsGeneratedByCompiler

from ctor in t.Constructors 
let virtualMethodsCalled = from mCalled in ctor.MethodsCalled
                           
where mCalled.IsVirtual &&
                                
(mCalled.ParentType == t ||
                                 
t.DeriveFrom(mCalled.ParentType))
                           
select mCalled
where virtualMethodsCalled.Count() > 0

select new { ctor , 
             
virtualMethodsCalled, 
             
// If there is no derived type, it might be 
             // an opportunity to mark t as sealed.
             t.DerivedTypes }

1 methods matched

methodvirtualMethodsCalledDerivedTypesFull Name
SymbolDatabase(constTokenizer*,constSettings*,ErrorLogger*)1 method0 typeSymbolDatabase.SymbolDatabase(constTokenizer*,constSettings* ,ErrorLogger*)

Statistics

Stat   virtualMethodsCalled   DerivedTypes
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Rule warning: Don't assign static fields from instance methods
• Rule Description:

Assigning static fields from instance methods leads to poorly maintainable and non-thread-safe code.

More discussion on the topic can be found here: http://codebetter.com/patricksmacchia/2011/05/04/back-to-basics-usage-of-static-members/


• How to Fix Violations:

If the static field is just assigned once in the program lifetime, make sure to declare it as readonly and assign it inline, or from the static constructor.

In Object-Oriented-Programming the natural artifact to hold states that can be modified is instance fields.

Hence to fix violations of this rule, make sure to hold assignable states through instance fields, not through static fields.

3 fields matched

fieldsassignedByFull Name
macroChar5 methodsPreprocessor.macroChar
missingIncludeFlag5 methodsPreprocessor.missingIncludeFlag
missingSystemIncludeFlag3 methodsPreprocessor.missingSystemIncludeFlag

Statistics

Stat   assignedBy
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Rule warning: Avoid Abstract Classes with too many methods
// <Name>Avoid Abstract Classes with too many methods</Name>
// An abstract class  should abstract a clear and well-defined concept.
// Such concept shoudln't be represented with too many methods and property getter.
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsAbstract
let methodsAndGetters = t.Methods
where methodsAndGetters.Count() > 10
select new { t, methodsAndGetters }

4 types matched

typesmethodsAndGettersFull Name
Check16 methodsCheck
ExecutionPath13 methodsExecutionPath
XMLNode49 methodstinyxml2.XMLNode
TestFixture23 methodsTestFixture

Statistics

Stat   methodsAndGetters
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

110
Design  

warningCritical    Rule warning: Nested types should not be visible
// <Name>Nested types should not be visible</Name>
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsNested && 
 
!t.IsGeneratedByCompiler &&
 
!t.IsPrivate 
select new { t, t.NbLinesOfCode, t.Visibility } 


// A nested type is a type declared within the 
// scope of another type. Nested types are useful 
// for encapsulating private implementation details 
// of the containing type. Used for this purpose, 
// nested types should not be externally visible. 
// Do not use externally visible nested types for 
// logical grouping or to avoid name collisions; 
// instead, use namespaces.

46 types matched

types# lines of code (LOC)VisibilityFull Name
Token+TypeN/APublicToken+Type
Suppressions+SuppressionEntry3PublicSuppressions+SuppressionEntry
InternalError+TypeN/APublicInternalError+Type
Severity+SeverityTypeN/APublicSeverity+SeverityType
ErrorLogger+ErrorMessage171PublicErrorLogger+ErrorMessage
ErrorLogger+ErrorMessage+FileLocation17PublicErrorLogger+ErrorMessage+FileLocation
Library+ErrorCodeN/APublicLibrary+ErrorCode
Library+Error6PublicLibrary+Error
Library+Container12PublicLibrary+Container
Library+Container+ActionN/APublicLibrary+Container+Action
Library+Container+YieldN/APublicLibrary+Container+Yield
Library+Container+Function0PublicLibrary+Container+Function
Library+ArgumentChecks5PublicLibrary+ArgumentChecks
Library+ArgumentChecks+MinSize3PublicLibrary+ArgumentChecks+MinSize
Library+ArgumentChecks+MinSize+TypeN/APublicLibrary+ArgumentChecks+MinSize+Type
Library+PodType0PublicLibrary+PodType
Library+PlatformType8PublicLibrary+PlatformType
Library+Platform2PublicLibrary+Platform
Settings+LanguageN/APublicSettings+Language
Settings+Rule3PublicSettings+Rule
Settings+PlatformTypeN/APublicSettings+PlatformType
Check+FileInfo0PublicCheck+FileInfo
Type+NeedInitializationN/APublicType+NeedInitialization
Type+BaseInfo5PublicType+BaseInfo
Type+FriendInfo3PublicType+FriendInfo
Function+TypeN/APublicFunction+Type
Scope+UsingInfo0PublicScope+UsingInfo
Scope+ScopeTypeN/APublicScope+ScopeType
CheckBufferOverrun+ArrayInfo35PublicCheckBufferOverrun+ArrayInfo
CheckBufferOverrun+MyFileInfo0PublicCheckBufferOverrun+MyFileInfo
CheckBufferOverrun+MyFileInfo+ArrayUsage0PublicCheckBufferOverrun+MyFileInfo+ArrayUsage
Filepointer+OperationN/APublicFilepointer+Operation
Filepointer+AppendModeN/APublicFilepointer+AppendMode
VarInfo+AllocStatusN/APublicVarInfo+AllocStatus
VarInfo+AllocInfo2PublicVarInfo+AllocInfo
CheckMemoryLeak+AllocTypeN/APublicCheckMemoryLeak+AllocType
CheckUninitVar+AllocN/APublicCheckUninitVar+Alloc
CheckUninitVar+MyFileInfo0PublicCheckUninitVar+MyFileInfo
Variables+VariableTypeN/APublicVariables+VariableType
Variables+VariableUsage11PublicVariables+VariableUsage
Variables+ScopeGuard4PublicVariables+ScopeGuard
Preprocessor+HeaderTypesN/APublicPreprocessor+HeaderTypes
StrPair+AnonymousEnumN/APublictinyxml2.StrPair+AnonymousEnum
MemPoolT<SIZE>+AnonymousEnumN/APublictinyxml2.MemPoolT<SIZE>+AnonymousEnum
XMLElement+AnonymousEnumN/APublictinyxml2.XMLElement+AnonymousEnum
TestPreprocessor+OurPreprocessor4PublicTestPreprocessor+OurPreprocessor

Statistics

Stat   # lines of code (LOC)   Visibility
Sum:2940
Average:12.250
Minimum:00
Maximum:1710
Standard deviation:33.940
Variance:1 1510

330
Architecture and Layering  

warningCritical    Rule warning: Avoid namespaces mutually dependent
// <Name>Avoid namespaces mutually dependent</Name>
warnif count > 0
// Foreach pair of namespace mutually dependent, this rule lists pairs.
// The pair { first, second } is formatted to show that first namespace shouldn't use the second namespace.
// The first/second order is inferred from the number of types used by each other.
// The first namespace is using less types of the second.
// It means that the first namespace is certainly at a lower level in the architecture, than the second.
// To explore the coupling between the two namespaces, you can export:
//  - typesOfFirstUsedBySecond to the vertical header of the dependency matrix
//  - typesOfSecondUsedByFirst to the horizontal header of the dependency matrix
//



// Optimization: restreint application Projects set
// If some namespaces are mutually dependent
//  - They must be declared in the same project
//  - The parent project must ContainsNamespaceDependencyCycle
from project in Application.Projects.Where(a => a.ContainsNamespaceDependencyCycle != null && a.ContainsNamespaceDependencyCycle.Value)

// hashset is used to avoid reporting both A <-> B and B <-> A
let hashset = new HashSet<INamespace>()

// Optimization: restreint namespaces set
// If a namespace doesn't have a Level value, it must be in a dependency cycle
// or it must be using directly or indirectly a dependency cycle.
let namespacesSuspect = project.ChildNamespaces.Where(n => n.Level == null && n.Name!="")

from nA in namespacesSuspect

// Select namespaces mutually dependent with nA
let unused = hashset.Add(nA) // Populate hashset
let namespacesMutuallyDependentWith_nA = nA.NamespacesUsed.Using(nA)
          
.Except(hashset) // <-- avoid reporting both A <-> B and B <-> A 
where namespacesMutuallyDependentWith_nA.Count() > 0

from nB in namespacesMutuallyDependentWith_nA

// nA and nB are mutually dependent
// Select first the one that shouldn't use the other.
// The first namespace is inferred from the fact that it is using less types of the second.
let typesOfBUsedByA = nB.ChildTypes.UsedBy(nA)
let typesOfAUsedByB = nA.ChildTypes.UsedBy(nB)
let first = (typesOfBUsedByA.Count() > typesOfAUsedByB.Count()) ? nB : nA
let second = (first == nA) ? nB : nA
let typesOfFirstUsedBySecond = (first == nA) ? typesOfAUsedByB : typesOfBUsedByA
let typesOfSecondUsedByFirst = (first == nA) ? typesOfBUsedByA : typesOfAUsedByB
where typesOfFirstUsedBySecond.Count()>0 && typesOfSecondUsedByFirst.Count()>0
select new { first, shouldntUse = second, typesOfFirstUsedBySecond, typesOfSecondUsedByFirst }

1 namespaces matched

namespaceshouldntUsetypesOfFirstUsedBySecondtypesOfSecondUsedByFirstFull Name
ValueFlow1 type1 typeValueFlow

Statistics

Stat   shouldntUse   typesOfFirstUsedBySecond   typesOfSecondUsedByFirst
Sum:000
Average:000
Minimum:000
Maximum:000
Standard deviation:000
Variance:000
warningCritical    Rule warning: Avoid namespaces dependency cycles
// <Name>Avoid namespaces dependency cycles</Name>
warnif count > 0
// This query lists all application namespaces dependency cyles.
// Each row shows a different cycle, prefixed with a namespace entangled in the cycle.
//
// To browse a cycle on the dependency graph or the dependency matrix, just right click
// a cycle cell and export namespaces matched to the dependency graph or matrix!
//
// In the matrix, dependency cycles are represented with red squares and black cells.
// To browse easily dependency cycles, the Matrix comes with the option:
//   --> Display Direct and Indirect Dependencies
//



// Optimization: restreint application Projects set
// If some namespaces are mutually dependent
//  - They must be declared in the same project
//  - The parent project must ContainsNamespaceDependencyCycle
from project in Application.Projects
                 
.Where(a => a.ContainsNamespaceDependencyCycle != null && 
                             
a.ContainsNamespaceDependencyCycle.Value)

// Optimization: restreint namespaces set
// A namespace involved in a cycle necessarily have a null Level.
let namespacesSuspect = project.ChildNamespaces.Where(n => n.Level == null && n.Name!="")

// hashset is used to avoid iterating again on namespaces already caught in a cycle.
let hashset = new HashSet<INamespace>()


from suspect in namespacesSuspect
   
// By commenting this line, the query matches all namespaces involved in a cycle.
   where !hashset.Contains(suspect)

   
// Define 2 code metrics
   // - Namespaces depth of is using indirectly the suspect namespace.
   // - Namespaces depth of is used by the suspect namespace indirectly.
   // Note: for direct usage the depth is equal to 1.
   let namespacesUserDepth = namespacesSuspect.DepthOfIsUsing(suspect)
   
let namespacesUsedDepth = namespacesSuspect.DepthOfIsUsedBy(suspect)

   
// Select namespaces that are both using and used by namespaceSuspect
   let usersAndUsed = from n in namespacesSuspect where 
                         
namespacesUserDepth[n] > 0 && 
                         
namespacesUsedDepth[n] > 0 
                      
select n

   
where usersAndUsed.Count() > 0

   
// Here we've found namespace(s) both using and used by the suspect namespace.
   // A cycle involving the suspect namespace is found!
   let cycle = usersAndUsed.Concat(new[] { suspect  })

   
// Fill hashset with namespaces in the cycle.
   // .ToArray() is needed to force the iterating process.
   let unused1 = (from n in cycle let unused2 = hashset.Add(n) select n).ToArray()

select new { suspect, cycle }

1 namespaces matched

namespacecycleFull Name
tinyxml25 namespacestinyxml2

Statistics

Stat   cycle
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Rule warning: Projects with poor cohesion (RelationalCohesion)
// <Name>Projects with poor cohesion (RelationalCohesion)</Name>
warnif count > 0 from a in Application.Projects where 
  
a.NbTypes > 20 && // Relational Cohesion metrics is relevant only if there are several types 
  (a.RelationalCohesion < 1.5 || 
   
a.RelationalCohesion > 4.0)
select new { a, a.NbTypes, a.RelationalCohesion }

// As classes inside an project should be strongly related, 
// the cohesion should be high. On the other hand, a value 
// which is too high may indicate over-coupling. A good range 
// for RelationalCohesion is 1.5 to 4.0.
// See the definition of the RelationalCohesion metric here 
// http://www.cppdepend.com/Metrics.aspx#RelationalCohesion

1 projects matched

project# TypesRelational cohesionFull Name
cppcheck1795.07cppcheck

Statistics

Stat   # Types   Relational cohesion
Sum:1795.07
Average:1795.07
Minimum:1795.07
Maximum:1795.07
Standard deviation:00
Variance:00

710
CppCheck Queries  

  • 7 validated Rule(s)
  • 1 Rule(s) violated
  • 0 Rules or Queries with Error (syntax error, exception thrown, time-out)
warningCritical    Rule warning: All CppCheck Violations
// <Name>All CppCheck Violations</Name>
warnif count>0          
from issue in Issues  where issue.ToolName=="CppCheck"
select new { issue,issue.FilePath,issue.BeginLine }

15 fields matched

fieldsFilePathBeginLineFull Name
Skipping configuration '_WIN32=1;_MSC_VER=1800;_UNICODE=1;UNICODE=1;CP PCHECKLIB_EXPORT=1;TINYXML2_EXPORT=1;WIN32=1;_CRT_SECURE_NO_WARNINGS=1 ;WIN32_LEAN_AND_MEAN=1;%(PreprocessorDefinitions )=1;_MT=1;MAXTIME' since the value of 'MAXTIME' is unknown . Use -D if you want to check it. You can use -U to skip it explicitly .C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp1CppCheck.information.information .Skipping configuration '_WIN32=1;_MSC_VER=1800;_UNICODE=1;UNICODE=1;C PPCHECKLIB_EXPORT=1;TINYXML2_EXPORT=1;WIN32=1;_CRT_SECURE_NO_WARNINGS= 1;WIN32_LEAN_AND_MEAN=1;%(PreprocessorDefinitions )=1;_MT=1;MAXTIME' since the value of 'MAXTIME' is unknown . Use -D if you want to check it. You can use -U to skip it explicitly .
Class 'XMLNode' has a constructor with 1 argument that is not explicit .C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h873CppCheck.style.style .Class 'XMLNode' has a constructor with 1 argument that is not explici t.
Class 'XMLComment' has a constructor with 1 argument that is not expli cit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h964CppCheck.style.style .Class 'XMLComment' has a constructor with 1 argument that is not expl icit.
Class 'XMLDeclaration' has a constructor with 1 argument that is not e xplicit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 002CppCheck.style.style .Class 'XMLDeclaration' has a constructor with 1 argument that is not explicit.
Class 'XMLUnknown' has a constructor with 1 argument that is not expli cit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 034CppCheck.style.style .Class 'XMLUnknown' has a constructor with 1 argument that is not expl icit.
Class 'XMLElement' has a constructor with 1 argument that is not expli cit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 489CppCheck.style.style .Class 'XMLElement' has a constructor with 1 argument that is not expl icit.
Skipping configuration '_WIN32=1;_MSC_VER=1800;_UNICODE=1;UNICODE=1;CP PCHECKLIB_EXPORT=1;TINYXML2_EXPORT=1;WIN32=1;_CRT_SECURE_NO_WARNINGS=1 ;WIN32_LEAN_AND_MEAN=1;%(PreprocessorDefinitions )=1;_MT=1;CFGDIR' since the value of 'CFGDIR' is unknown . Use -D if you want to check it. You can use -U to skip it explicitly .C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\library.cpp1CppCheck.information.information .Skipping configuration '_WIN32=1;_MSC_VER=1800;_UNICODE=1;UNICODE=1;C PPCHECKLIB_EXPORT=1;TINYXML2_EXPORT=1;WIN32=1;_CRT_SECURE_NO_WARNINGS= 1;WIN32_LEAN_AND_MEAN=1;%(PreprocessorDefinitions )=1;_MT=1;CFGDIR' since the value of 'CFGDIR' is unknown . Use -D if you want to check it. You can use -U to skip it explicitly .
Memory is allocated but not initialized: blockC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h364CppCheck.error.error.Memory is allocated but not initialized: block
Abstract class 'XMLNode' has a copy/move constructor that is not expli cit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h875CppCheck.style.style .Abstract class 'XMLNode' has a copy/move constructor that is not expl icit.
Class 'XMLText' has a constructor with 1 argument that is not explicit .C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h935CppCheck.style.style .Class 'XMLText' has a constructor with 1 argument that is not explici t.
Class 'XMLHandle' has a constructor with 1 argument that is not explic it.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 790CppCheck.style.style .Class 'XMLHandle' has a constructor with 1 argument that is not expli cit.
Class 'XMLHandle' has a constructor with 1 argument that is not explic it.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 794CppCheck.style.style .Class 'XMLHandle' has a constructor with 1 argument that is not expli cit.
Class 'XMLConstHandle' has a constructor with 1 argument that is not e xplicit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 873CppCheck.style.style .Class 'XMLConstHandle' has a constructor with 1 argument that is not explicit.
Class 'XMLConstHandle' has a constructor with 1 argument that is not e xplicit.C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.h1 876CppCheck.style.style .Class 'XMLConstHandle' has a constructor with 1 argument that is not explicit.
Skipping configuration '_WIN32=1;_MSC_VER=1800;_UNICODE=1;UNICODE=1;CP PCHECKLIB_IMPORT=1;WIN32=1;_CRT_SECURE_NO_WARNINGS=1;WIN32_LEAN_AND_ME AN=1;%(PreprocessorDefinitions )=1;_MT=1;CFGDIR' since the value of 'CFGDIR' is unknown . Use -D if you want to check it. You can use -U to skip it explicitly .C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cppcheckexecutor.cpp1CppCheck.information.information .Skipping configuration '_WIN32=1;_MSC_VER=1800;_UNICODE=1;UNICODE=1;C PPCHECKLIB_IMPORT=1;WIN32=1;_CRT_SECURE_NO_WARNINGS=1;WIN32_LEAN_AND_M EAN=1;%(PreprocessorDefinitions )=1;_MT=1;CFGDIR' since the value of 'CFGDIR' is unknown . Use -D if you want to check it. You can use -U to skip it explicitly .

Statistics

Stat   FilePath   BeginLine
Sum:014 872
Average:0991.47
Minimum:01
Maximum:01 876
Standard deviation:0656.2
Variance:0430 600

850
Diagnostics Queries  

warningCritical    Rule warning: All diagnostics
// <Name>All diagnostics</Name> 
warnif count > 0
from issue in Issues  where issue.ToolName=="Clang"
select new { issue,issue.FilePath,issue.BeginLine }
        

1,211 fields matched

fieldsFilePathBeginLineFull Name
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp6 126Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp6 126Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp6 132Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp6 132Clang.diagnostic.diagnostic.declaration requires a global destructor
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.cpp33Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.cpp35Clang.diagnostic.diagnostic.use of old-style cast
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\check64bit.cpp30Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\check64bit.cpp30Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkassert.cpp31Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkassert.cpp31Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkautovariables.cpp33Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkautovariables.cpp33Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbool.cpp28Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbool.cpp28Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkboost.cpp24Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkboost.cpp24Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp39Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp39Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkclass.cpp35Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkclass.cpp35Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp31Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp31Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkstring.cpp28Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkstring.cpp28Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkexceptionsafety.cpp27Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkexceptionsafety.cpp27Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cpp32Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cpp32Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkleakautovar.cpp33Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkleakautovar.cpp33Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp34Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp34Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp35Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp35Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp36Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp36Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp37Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp37Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checknonreentrantfunctions.cpp31Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checknonreentrantfunctions.cpp31Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checknullpointer.cpp29Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checknullpointer.cpp29Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkobsolescentfunctions.cpp31Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkobsolescentfunctions.cpp31Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkother.cpp32Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkother.cpp32Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkpostfixoperator.cpp32Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkpostfixoperator.cpp32Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checksizeof.cpp29Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checksizeof.cpp29Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkstl.cpp27Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkstl.cpp27Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checktype.cpp30Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checktype.cpp30Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp34Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp34Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkunusedfunctions.cpp31Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkunusedfunctions.cpp31Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkunusedvar.cpp30Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkunusedvar.cpp30Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkvaarg.cpp26Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkvaarg.cpp26Clang.diagnostic.diagnostic.declaration requires a global destructor
declaration requires an exit-time destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\cppcheck.cpp41Clang.diagnostic.diagnostic .declaration requires an exit-time destructor
declaration requires a global destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\cppcheck.cpp41Clang.diagnostic.diagnostic.declaration requires a global destructor
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkautovariables.cpp86Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp287Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp307Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp316Clang.diagnostic.diagnostic.use of old-style cast
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp325Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp329Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp557Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp558Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp559Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp560Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp561Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp562Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp568Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp573Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp574Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp575Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp576Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp577Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp578Clang.diagnostic.diagnostic.use of old-style cast
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkexceptionsafety.cpp194Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkexceptionsafety.cpp197Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkexceptionsafety.cpp221Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cpp491Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.cpp51Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkother.cpp82Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkother.cpp84Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'long long' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checktype.cpp51Clang.diagnostic.diagnostic.'long long' is incompatible with C++98
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\errorlogger.cpp240Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp65Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp70Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp72Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp78Clang.diagnostic.diagnostic.use of old-style cast
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp1 150Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
'nullptr' is incompatible with C++98C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp1 181Clang.diagnostic.diagnostic.'nullptr' is incompatible with C++98
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 514Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 829Clang.diagnostic.diagnostic.use of old-style cast

Statistics

Stat   FilePath   BeginLine
Sum:02 096 159
Average:01 730
Minimum:021
Maximum:09 988
Standard deviation:01 991
Variance:03 965 606
warningCritical    Rule warning: Cast issues
// <Name>Cast issues</Name>
warnif count > 0
from issue in Issues  where issue.ToolName=="Clang" && issue.Type.Contains("cast")
select new { issue,issue.FilePath,issue.BeginLine }
        

293 fields matched

fieldsFilePathBeginLineFull Name
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.cpp33Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.cpp35Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp307Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp316Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp557Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp558Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp559Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp560Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp561Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp562Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp568Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp573Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp574Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp575Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp576Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp577Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkcondition.cpp578Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\errorlogger.cpp240Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp65Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp70Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp72Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp78Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 514Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 829Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 835Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 841Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.cpp1 433Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.cpp1 435Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion loses integer precision: 'MathLib::bigint' (aka 'long long') to 'size_type' (aka 'unsigned int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.cpp1 434Clang.diagnostic.diagnostic .implicit conversion loses integer precision: 'MathLib::bigint' (aka 'long long') to 'size_type' (aka 'unsigned int')
implicit conversion changes signedness: 'unsigned int' to 'int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.cpp78Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'int'
implicit conversion loses integer precision: 'const MathLib::bigint' (aka 'const long long') to 'size_type' (aka 'unsigned int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.cpp391Clang.diagnostic.diagnostic .implicit conversion loses integer precision: 'const MathLib::bigint' (aka 'const long long') to 'size_type' (aka 'unsigned int')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\mathlib.cpp95Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\mathlib.cpp124Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\mathlib.cpp126Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\mathlib.cpp41Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\mathlib.cpp70Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\token.cpp66Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\token.cpp71Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion loses integer precision: 'biguint' (aka 'unsigned long long') to 'unsigned int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\errorlogger.cpp164Clang.diagnostic.diagnostic .implicit conversion loses integer precision: 'biguint' (aka 'unsigned long long') to 'unsigned int'
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\errorlogger.cpp300Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'int' to 'std::string::size_ty pe' (aka 'unsigned int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\errorlogger.cpp300Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'int' to 'std::string::size_t ype' (aka 'unsigned int')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp236Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp268Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp301Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp305Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp310Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp376Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp80Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp406Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenlist.cpp409Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp2 106Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp2 118Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion loses integer precision: 'long long' to 'std::size _t' (aka 'unsigned int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp3 136Clang.diagnostic.diagnostic .implicit conversion loses integer precision: 'long long' to 'std::siz e_t' (aka 'unsigned int')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp5 577Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'int' to 'size_type' (aka 'unsigned int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp1 129Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'int' to 'size_type' (aka 'unsigned int')
implicit conversion changes signedness: 'size_type' (aka 'unsigned int') to 'std::string::difference_type' (aka 'int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp6 467Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'size_type' (aka 'unsigned int') to 'std::string::difference_type' (aka 'int')
implicit conversion changes signedness: 'std::string::difference_type' (aka 'int') to 'size_type' (aka 'unsigned int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp6 468Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'std::string::difference_type ' (aka 'int') to 'size_type' (aka 'unsigned int')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp7 181Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp7 182Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp8 789Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp8 801Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp8 808Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'int' to 'unsigned long'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cpp9 461Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'int' to 'unsigned long'
implicit conversion changes signedness: 'int' to 'unsigned int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\library.cpp508Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'int' to 'unsigned int'
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\timer.cpp54Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\timer.cpp95Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'difference_type' (aka 'int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\symboldatabase.cpp3 227Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'std::size_t' (aka 'unsigned int') to 'difference_type' (aka 'int')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\symboldatabase.cpp1 013Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'unsigned long long' to 'MathL ib::bigint' (aka 'long long')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\symboldatabase.cpp1 124Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned long long' to 'Math Lib::bigint' (aka 'long long')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp1 461Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp1 006Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'unsigned int' to 'int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp1 539Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'int'
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp900Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp949Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp962Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp663Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'unsigned int' to 'int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp354Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'int'
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkbufferoverrun.cpp365Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkclass.cpp1 030Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkstring.cpp240Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkstring.cpp245Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cpp407Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cpp632Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp1 307Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'unsigned int' to 'mapped_type ' (aka 'int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp1 312Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'mapped_typ e' (aka 'int')
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp1 337Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'unsigned int' to 'mapped_type ' (aka 'int')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp1 342Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'mapped_typ e' (aka 'int')
implicit conversion changes signedness: 'unsigned int' to 'int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp1 776Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'int'
implicit conversion changes signedness: 'unsigned int' to 'int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkuninitvar.cpp1 777Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'int'
implicit conversion changes signedness: 'int' to 'unsigned int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checknullpointer.cpp68Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'int' to 'unsigned int'
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checknullpointer.cpp109Clang.diagnostic.diagnostic.use of old-style cast
implicit conversion changes signedness: 'unsigned int' to 'int'C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checktype.cpp127Clang.diagnostic.diagnostic .implicit conversion changes signedness: 'unsigned int' to 'int'
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp179Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp181Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp229Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 918Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp2 920Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp3 083Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp3 088Clang.diagnostic.diagnostic.use of old-style cast
use of old-style castC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\preprocessor.cpp3 093Clang.diagnostic.diagnostic.use of old-style cast

Statistics

Stat   FilePath   BeginLine
Sum:0433 870
Average:01 480
Minimum:033
Maximum:09 461
Standard deviation:01 592
Variance:02 537 298
warningCritical    Rule warning: Conversion Issues
// <Name>Conversion Issues</Name>
warnif count > 0
from issue in Issues  where issue.ToolName=="Clang" && issue.Type.Contains("conversion")
select new { issue,issue.FilePath,issue.BeginLine }
        

3 fields matched

fieldsFilePathBeginLineFull Name
format specifies type 'void *' but the argument has type 'ULONG_PTR' (aka 'unsigned long')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cppcheckexecutor.cpp604Clang.diagnostic.diagnostic .format specifies type 'void *' but the argument has type 'ULONG_PTR' (aka 'unsigned long')
format specifies type 'void *' but the argument has type 'ULONG_PTR' (aka 'unsigned long')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cppcheckexecutor.cpp608Clang.diagnostic.diagnostic .format specifies type 'void *' but the argument has type 'ULONG_PTR' (aka 'unsigned long')
format specifies type 'void *' but the argument has type 'ULONG_PTR' (aka 'unsigned long')C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cppcheckexecutor.cpp612Clang.diagnostic.diagnostic .format specifies type 'void *' but the argument has type 'ULONG_PTR' (aka 'unsigned long')

Statistics

Stat   FilePath   BeginLine
Sum:01 824
Average:0608
Minimum:0604
Maximum:0612
Standard deviation:03.26
Variance:010.66
warningCritical    Rule warning: Deprecated Usage
// <Name>Deprecated Usage</Name>
warnif count > 0
from issue in Issues  where issue.ToolName=="Clang" && issue.Type.Contains("deprecated")
select new { issue,issue.FilePath,issue.BeginLine }
        

1 fields matched

fieldFilePathBeginLineFull Name
definition of implicit copy constructor for 'ScopeGuard' is deprecated because it has a user-declared destructorC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkunusedvar.cpp91Clang.diagnostic.diagnostic .definition of implicit copy constructor for 'ScopeGuard' is deprecate d because it has a user-declared destructor

Statistics

Stat   FilePath   BeginLine
Sum:091
Average:091
Minimum:091
Maximum:091
Standard deviation:00
Variance:00
warningCritical    Rule warning: Switch Issues
// <Name>Switch Issues</Name>
warnif count > 0
from issue in Issues  where issue.ToolName=="Clang" && (issue.Type.Contains("switch") || issue.Type.Contains("case"))
select new { issue,issue.FilePath,issue.BeginLine }
        

3 fields matched

fieldsFilePathBeginLineFull Name
enumeration values 'SUFFIX_ULL', 'SUFFIX_LLU' , and 'SUFFIX_I64' not explicitly handled in switchC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\mathlib.cpp375Clang.diagnostic.diagnostic.enumeration values 'SUFFIX_ULL' , 'SUFFIX_LLU', and 'SUFFIX_I64' not explicitly handled in switch
11 enumeration values not explicitly handled in switch: 'eFunction' , 'eIf', 'eElse'...C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\symboldatabase.cpp2 748Clang.diagnostic.diagnostic .11 enumeration values not explicitly handled in switch: 'eFunction' , 'eIf', 'eElse'...
enumeration value 'NONE' not explicitly handled in switchC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cpp261Clang.diagnostic.diagnostic .enumeration value 'NONE' not explicitly handled in switch

Statistics

Stat   FilePath   BeginLine
Sum:03 384
Average:01 128
Minimum:0261
Maximum:02 748
Standard deviation:01 146
Variance:01 314 366

210
Dead Code  

  • 2 validated Rule(s)
  • 1 Rule(s) violated
  • 0 Rules or Queries with Error (syntax error, exception thrown, time-out)
warningCritical    Rule warning: Potentially dead Methods
// <Name>Potentially dead Methods</Name>
warnif count > 0
// Filter procedure for methods that should'nt be considered as dead
let canMethodBeConsideredAsDeadProc = new Func<IMethod, bool>(
    
m => !m.IsPublic &&       // Public methods might be used by client applications of your Projects.
         !m.IsEntryPoint &&            // Main() method is not used by-design.
         !m.IsClassConstructor &&      
         
!m.IsVirtual &&               // Only check for non virtual method that are not seen as used in IL.
         !(m.IsConstructor &&          // Don't take account of protected ctor that might be call by a derived ctors.
           m.IsProtected) &&
         
!m.NameLike (@"^On") &&        //Exclude Events like MFC ones
         !m.IsGeneratedByCompiler
)

// Get methods unused
let methodsUnused = 
   
from m in JustMyCode.Methods where 
   
m.NbMethodsCallingMe == 0 && 
   
canMethodBeConsideredAsDeadProc(m)
   
select m

// Dead methods = methods used only by unused methods (recursive)
let deadMethodsMetric = methodsUnused.FillIterative(
   
methods => // Unique loop, just to let a chance to build the hashset.
              from o in new[] { new object() }
              
// Use a hashet to make Intersect calls much faster!
              let hashset = methods.ToHashSet()
              
from m in codeBase.Application.Methods.UsedByAny(methods).Except(methods)
              
where canMethodBeConsideredAsDeadProc(m) &&
                    
// Select methods called only by methods already considered as dead
                    hashset.Intersect(m.MethodsCallingMe).Count() == m.NbMethodsCallingMe
              
select m)

from m in JustMyCode.Methods.Intersect(deadMethodsMetric.DefinitionDomain)
select new { m, m.MethodsCallingMe, depth = deadMethodsMetric[m] }

3,134 methods matched

methodsMethodsCallingMedepthFull Name
Token()0 method0Token.Token()
Token(constToken&)0 method0Token.Token(constToken&)
operator=(constToken&)0 method0Token.operator=(constToken&)
TokenList(constTokenList&)0 method0TokenList.TokenList(constTokenList&)
operator=(constTokenList&)0 method0TokenList.operator=(constTokenList&)
Tokenizer(constTokenizer&)0 method0Tokenizer.Tokenizer(constTokenizer&)
operator=(constTokenizer&)0 method0Tokenizer.operator=(constTokenizer&)
operator=(constTimer&)0 method0Timer.operator=(constTimer&)
operator=(constCheck&)0 method0Check.operator=(constCheck&)
Check(constCheck&)0 method0Check.Check(constCheck&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0Check64BitPortability.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0Check64BitPortability.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckAssert.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckAssert.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckAutoVariables.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckAutoVariables.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckBool.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckBool.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckBoost.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckBoost.classInfo()
classInfo()0 method0CheckBufferOverrun.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckClass.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckClass.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckCondition.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckCondition.classInfo()
redundantGetAndSetUserIdError(constToken*)0 method0CheckOther.redundantGetAndSetUserIdError(constToken*)
duplicateIfError(constToken*,constToken*)0 method0CheckOther.duplicateIfError(constToken*,constToken*)
alwaysTrueFalseStringCompareError(constToken*,conststd::string& ,conststd::string&)0 method0CheckOther.alwaysTrueFalseStringCompareError(constToken* ,conststd::string&,conststd::string&)
alwaysTrueStringVariableCompareError(constToken*,conststd::string& ,conststd::string&)0 method0CheckOther.alwaysTrueStringVariableCompareError(constToken* ,conststd::string&,conststd::string&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckOther.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckOther.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckString.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckString.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckExceptionSafety.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckExceptionSafety.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckIO.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckIO.classInfo()
ArgumentInfo(constCheckIO::ArgumentInfo&)0 method0CheckIO+ArgumentInfo.ArgumentInfo(constCheckIO::ArgumentInfo&)
operator=(constCheckIO::ArgumentInfo&)0 method0CheckIO+ArgumentInfo.operator=(constCheckIO::ArgumentInfo&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckLeakAutoVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckLeakAutoVar.classInfo()
CheckMemoryLeak()0 method0CheckMemoryLeak.CheckMemoryLeak()
CheckMemoryLeak(constCheckMemoryLeak&)0 method0CheckMemoryLeak.CheckMemoryLeak(constCheckMemoryLeak&)
operator=(constCheckMemoryLeak&)0 method0CheckMemoryLeak.operator=(constCheckMemoryLeak&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakInFunction.getErrorMessages(ErrorLogger*,constSettings* )
classInfo()0 method0CheckMemoryLeakInFunction.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakInClass.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckMemoryLeakInClass.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakStructMember.getErrorMessages(ErrorLogger* ,constSettings*)
classInfo()0 method0CheckMemoryLeakStructMember.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakNoVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckMemoryLeakNoVar.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckUninitVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckUninitVar.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckNonReentrantFunctions.getErrorMessages(ErrorLogger* ,constSettings*)
classInfo()0 method0CheckNonReentrantFunctions.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckNullPointer.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckNullPointer.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckObsoleteFunctions.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckObsoleteFunctions.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckPostfixOperator.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckPostfixOperator.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckSizeof.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckSizeof.classInfo()
eraseCheckLoop(constToken*)0 method0CheckStl.eraseCheckLoop(constToken*)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckStl.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckStl.classInfo()
operator=(constExecutionPath&)0 method0ExecutionPath.operator=(constExecutionPath&)
is_equal(constExecutionPath*)0 method0EraseCheckLoop.is_equal(constExecutionPath*)
parse(constToken&,std::list<ExecutionPath*>&)0 method0EraseCheckLoop.parse(constToken&,std::list<ExecutionPath*>&)
parseCondition(constToken&,std::list<ExecutionPath*>&)0 method0EraseCheckLoop.parseCondition(constToken&,std::list<ExecutionPath*>&)
isUnsigned(constVariable*)0 method0CheckType.isUnsigned(constVariable*)
isSigned(constVariable*)0 method0CheckType.isSigned(constVariable*)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckType.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckType.classInfo()
copy()0 method0UninitVar.copy()
UninitVar(Check*,constVariable*,constSymbolDatabase*,constLibrary* ,bool)1 method2UninitVar.UninitVar(Check*,constVariable*,constSymbolDatabase* ,constLibrary*,bool)
is_equal(constExecutionPath*)0 method0UninitVar.is_equal(constExecutionPath*)
alloc_pointer(std::list<ExecutionPath*>&,unsignedint)1 method2UninitVar.alloc_pointer(std::list<ExecutionPath*>&,unsignedint)
init_pointer(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.init_pointer(std::list<ExecutionPath*>&,constToken*)
dealloc_pointer(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.dealloc_pointer(std::list<ExecutionPath*>&,constToken*)
pointer_assignment(std::list<ExecutionPath*>&,constToken*,constToken*)1 method2UninitVar.pointer_assignment(std::list<ExecutionPath*>&,constToken* ,constToken*)
init_strncpy(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.init_strncpy(std::list<ExecutionPath*>&,constToken*)
init_memset_nonzero(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.init_memset_nonzero(std::list<ExecutionPath*>&,constToken*)
use_dead_pointer(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.use_dead_pointer(std::list<ExecutionPath*>&,constToken*)
parserhs(constToken*,std::list<ExecutionPath*>&)1 method2UninitVar.parserhs(constToken*,std::list<ExecutionPath*>&)
parse(constToken&,std::list<ExecutionPath*>&)1 method1UninitVar.parse(constToken&,std::list<ExecutionPath*>&)
parseCondition(constToken&,std::list<ExecutionPath*>&)0 method0UninitVar.parseCondition(constToken&,std::list<ExecutionPath*>&)
parseLoopBody(constToken*,std::list<ExecutionPath*>&)0 method0UninitVar.parseLoopBody(constToken*,std::list<ExecutionPath*>&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckUnusedFunctions.getErrorMessages(ErrorLogger*,constSettings*)
runSimplifiedChecks(constTokenizer*,constSettings*,ErrorLogger*)0 method0CheckUnusedFunctions.runSimplifiedChecks(constTokenizer* ,constSettings*,ErrorLogger*)
classInfo()0 method0CheckUnusedFunctions.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckUnusedVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckUnusedVar.classInfo()
operator=(constVariables::ScopeGuard&)0 method0Variables+ScopeGuard.operator=(constVariables::ScopeGuard&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckVaarg.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckVaarg.classInfo()
reportProgress(conststd::string&,constchar*,conststd::size_t)0 method0CppCheck.reportProgress(conststd::string&,constchar*,conststd::size_t)
operator=(constPreprocessorMacro&)0 method0PreprocessorMacro.operator=(constPreprocessorMacro&)
TemplateSimplifier()0 method0TemplateSimplifier.TemplateSimplifier()

Statistics

Stat   MethodsCallingMe   depth
Sum:03 083
Average:00.98
Minimum:00
Maximum:02
Standard deviation:00.31
Variance:00.097

020
Visibility  

warningCritical    Rule warning: Fields should be declared as private
// <Name>Fields should be declared as private</Name>
warnif count > 0 from f in Application.Fields where 
 
!f.IsPrivate && 

 
// These conditions filter cases where fields 
 // doesn't represent state that should be encapsulated. 
 !f.IsGeneratedByCompiler && 
 
!f.IsEnumValue
select new { f }

399 fields matched

fieldsFull Name
TIXML2_MAJOR_VERSION__Globals.TIXML2_MAJOR_VERSION
TIXML2_MINOR_VERSION__Globals.TIXML2_MINOR_VERSION
TIXML2_PATCH_VERSION__Globals.TIXML2_PATCH_VERSION
LINE_FEED__Globals.LINE_FEED
LF__Globals.LF
CARRIAGE_RETURN__Globals.CARRIAGE_RETURN
CR__Globals.CR
SINGLE_QUOTE__Globals.SINGLE_QUOTE
DOUBLE_QUOTE__Globals.DOUBLE_QUOTE
TIXML_UTF_LEAD_0__Globals.TIXML_UTF_LEAD_0
TIXML_UTF_LEAD_1__Globals.TIXML_UTF_LEAD_1
TIXML_UTF_LEAD_2__Globals.TIXML_UTF_LEAD_2
emptyString__Globals.emptyString
call_func_white_list__Globals.call_func_white_list
Version__Globals.Version
ExtraVersion__Globals.ExtraVersion
S_timerResults__Globals.S_timerResults
cAlternativeTokens___Globals.cAlternativeTokens_
cAlternativeTokens__Globals.cAlternativeTokens
AST_MAX_DEPTH__Globals.AST_MAX_DEPTH
valuesToken.values
_functionToken+Anonymous._function
_variableToken+Anonymous._variable
idSuppressions+SuppressionEntry.id
fileSuppressions+SuppressionEntry.file
lineSuppressions+SuppressionEntry.line
tokenInternalError.token
errorMessageInternalError.errorMessage
idInternalError.id
_callStackErrorLogger+ErrorMessage._callStack
_idErrorLogger+ErrorMessage._id
file0ErrorLogger+ErrorMessage.file0
_severityErrorLogger+ErrorMessage._severity
_cweErrorLogger+ErrorMessage._cwe
_inconclusiveErrorLogger+ErrorMessage._inconclusive
lineErrorLogger+ErrorMessage+FileLocation.line
listTokenizer.list
useLibrary.use
leakignoreLibrary.leakignore
functionconstLibrary.functionconst
functionpureLibrary.functionpure
useretvalLibrary.useretval
containersLibrary.containers
argumentChecksLibrary.argumentChecks
returnuninitdataLibrary.returnuninitdata
definesLibrary.defines
errorcodeLibrary+Error.errorcode
reasonLibrary+Error.reason
startPatternLibrary+Container.startPattern
endPatternLibrary+Container.endPattern
functionsLibrary+Container.functions
type_templateArgNoLibrary+Container.type_templateArgNo
size_templateArgNoLibrary+Container.size_templateArgNo
arrayLike_indexOpLibrary+Container.arrayLike_indexOp
stdStringLikeLibrary+Container.stdStringLike
actionLibrary+Container+Function.action
yieldLibrary+Container+Function.yield
notboolLibrary+ArgumentChecks.notbool
notnullLibrary+ArgumentChecks.notnull
notuninitLibrary+ArgumentChecks.notuninit
formatstrLibrary+ArgumentChecks.formatstr
strzLibrary+ArgumentChecks.strz
validLibrary+ArgumentChecks.valid
minsizesLibrary+ArgumentChecks.minsizes
typeLibrary+ArgumentChecks+MinSize.type
argLibrary+ArgumentChecks+MinSize.arg
arg2Library+ArgumentChecks+MinSize.arg2
sizeLibrary+PodType.size
signLibrary+PodType.sign
_typeLibrary+PlatformType._type
_signedLibrary+PlatformType._signed
_unsignedLibrary+PlatformType._unsigned
_longLibrary+PlatformType._long
_pointerLibrary+PlatformType._pointer
_ptr_ptrLibrary+PlatformType._ptr_ptr
_const_ptrLibrary+PlatformType._const_ptr
_platform_typesLibrary+Platform._platform_types
_clocksTimerResultsData._clocks
_numberOfResultsTimerResultsData._numberOfResults
debugSettings.debug
debugwarningsSettings.debugwarnings
debugFalsePositiveSettings.debugFalsePositive
dumpSettings.dump
exceptionHandlingSettings.exceptionHandling
inconclusiveSettings.inconclusive
jointSuppressionReportSettings.jointSuppressionReport
experimentalSettings.experimental
_errorsOnlySettings._errorsOnly
_inlineSuppressionsSettings._inlineSuppressions
_verboseSettings._verbose
_forceSettings._force
_relativePathsSettings._relativePaths
_basePathsSettings._basePaths
_xmlSettings._xml
_xml_versionSettings._xml_version
_jobsSettings._jobs
_loadAverageSettings._loadAverage
_exitCodeSettings._exitCode
_outputFormatSettings._outputFormat
_showtimeSettings._showtime

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warningCritical    Rule warning: Constructors of abstract classes should be declared as protected or private
// <Name>Constructors of abstract classes should be declared as protected or private</Name>
// Constructors of an abstract class can only be accessed from this class and derived class.
// Declaring such a constructor with another visibility level is useless and potentially misleading.

warnif count > 0
from t in Application.Types where 
  
t.IsClass && 
  
t.IsAbstract
let ctors = t.Constructors.Where(c => !c.IsProtected && !c.IsPrivate)
where ctors.Count() > 0
select new { t, ctors }

// Notice that if a constructor of an abstract class is declared as private,
// it can only be accessed from derived classes nested in the abstract class.

6 types matched

typesctorsFull Name
ErrorLogger2 methodsErrorLogger
TimerResultsIntf2 methodsTimerResultsIntf
Check2 methodsCheck
ExecutionPath2 methodsExecutionPath
MemPool2 methodstinyxml2.MemPool
TestFixture2 methodsTestFixture

Statistics

Stat   ctors
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

230
Purity - Immutability - Constness  

warningCritical    Rule warning: Structures should be immutable
// <Name>Structures should be immutable</Name>
warnif count > 0 from t in Application.Types where 
   
t.IsStructure && 
  
!t.IsImmutable

let mutableFields = t.Fields.Where(f => !f.IsImmutable)

select new { t, t.NbLinesOfCode, mutableFields }

// It is deemed as a good practice to make 
// your structure immutable.
// An object is immutable if its state doesn’t 
// change once the object has been created. 
// Consequently, a structure is immutable if 
// its instances are immutable.
// Immutable types naturally simplify code by 
// limiting side-effects.

22 types matched

types# lines of code (LOC)mutableFieldsFull Name
Suppressions+SuppressionEntry33 fieldsSuppressions+SuppressionEntry
InternalError93 fieldsInternalError
Library+Container+Function02 fieldsLibrary+Container+Function
Library+PodType02 fieldsLibrary+PodType
Library+PlatformType87 fieldsLibrary+PlatformType
Library+Platform21 fieldLibrary+Platform
TimerResultsData42 fieldsTimerResultsData
Dimension44 fieldsDimension
Type+FriendInfo34 fieldsType+FriendInfo
Scope+UsingInfo02 fieldsScope+UsingInfo
CheckBufferOverrun+MyFileInfo+ArrayUsage03 fieldsCheckBufferOverrun+MyFileInfo+ArrayUsage
CheckClass+Usage22 fieldsCheckClass+Usage
VarInfo22 fieldsVarInfo
Filepointer55 fieldsFilepointer
VarInfo+AllocInfo22 fieldsVarInfo+AllocInfo
Space23 fieldsSpace
AST_state34 fieldsAST_state
MemPoolT<SIZE>+Block01 fieldtinyxml2.MemPoolT<SIZE>+Block
Entity03 fieldstinyxml2.Entity
scopeStackEntryType42 fieldsanonymous_namespace{tokenize.cpp}.scopeStackEntryType
IMAGEHLP_SYMBOL64_EXT01 fieldIMAGEHLP_SYMBOL64_EXT
IMAGEHLP_SYMBOL64_EXT01 fieldIMAGEHLP_SYMBOL64_EXT

Statistics

Stat   # lines of code (LOC)   mutableFields
Sum:530
Average:2.410
Minimum:00
Maximum:90
Standard deviation:2.50
Variance:6.240
warningCritical    Rule warning: Avoid static fields with a mutable field type
// <Name>Avoid static fields with a mutable field type</Name>
warnif count > 0
from f in Application.Fields
where f.IsStatic && !f.IsEnumValue && !f.IsGeneratedByCompiler
let fieldType = f.FieldType
where fieldType != null && 
     
!fieldType.IsThirdParty && 
     
!fieldType.IsInterface && 
     
!fieldType.IsImmutable
select new { f, 
             
mutableFieldType = fieldType , 
             
isFieldImmutable = f.IsImmutable }


9 fields matched

fieldsmutableFieldTypeisFieldImmutableFull Name
instanceCheckUnusedFunctionsFalseCheckUnusedFunctions.instance
entitiesEntityFalsetinyxml2.__Globals.entities
instanceCheckAutoVariablesFalseanonymous_namespace{checkautovariables.cpp}.__Globals.instance
testMemleakTestMemleakFalse__Globals.testMemleak
testMemleakInFunctionTestMemleakInFunctionFalse__Globals.testMemleakInFunction
testMemleakInClassTestMemleakInClassFalse__Globals.testMemleakInClass
testMemleakStructMemberTestMemleakStructMemberFalse__Globals.testMemleakStructMember
testMemleakGLibTestMemleakGLibFalse__Globals.testMemleakGLib
testMemleakWindowsTestMemleakWindowsFalse__Globals.testMemleakWindows

Statistics

Stat   mutableFieldType   isFieldImmutable
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Rule warning: Use const_cast carrefully

          
// <Name>Use const_cast carrefully</Name>
          warnif count >0 (from m in Methods where m.IsUsing ("Keywords.const_cast")
          
select new { m, m.NbLinesOfCode }).Take(10)
          

10 methods matched

methods# lines of code (LOC)Full Name
createAstAtToken(Token*,bool)69__Globals.createAstAtToken(Token*,bool)
setTokenValue(Token*,constValueFlow::Value&)90__Globals.setTokenValue(Token*,constValueFlow::Value&)
valueFlowBeforeCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)155__Globals.valueFlowBeforeCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
valueFlowForward(Token*const,constToken*const,constVariable*const ,constunsignedint,std::list<ValueFlow::Value>,constbool ,TokenList*const,ErrorLogger*const,constSettings*const)206__Globals.valueFlowForward(Token*const,constToken*const ,constVariable*const,constunsignedint,std::list<ValueFlow::Value> ,constbool,TokenList*const,ErrorLogger*const,constSettings*const)
valueFlowAfterAssign(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)18__Globals.valueFlowAfterAssign(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)
valueFlowAfterCondition(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)102__Globals.valueFlowAfterCondition(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
valueFlowForLoop(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)26__Globals.valueFlowForLoop(TokenList*,SymbolDatabase*,ErrorLogger* ,constSettings*)
valueFlowInjectParameter(TokenList*,ErrorLogger*,constSettings* ,constVariable*,constScope*,conststd::list<ValueFlow::Value>&)6__Globals.valueFlowInjectParameter(TokenList*,ErrorLogger* ,constSettings*,constVariable*,constScope*,conststd::list <ValueFlow::Value>&)
valueFlowFunctionDefaultParameter(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)16__Globals.valueFlowFunctionDefaultParameter(TokenList*,SymbolDatabase* ,ErrorLogger*,constSettings*)
tokAt(int)1Token.tokAt(int)

Statistics

Stat   # lines of code (LOC)
Sum:689
Average:68.9
Minimum:1
Maximum:206
Standard deviation:65.99
Variance:4 354

360
Naming Conventions  

warningCritical    Rule warning: Instance fields should be prefixed with a 'm_'
// <Name>Instance fields should be prefixed with a 'm_'</Name>
warnif count > 0 (from f in Fields where 
  
!f.NameLike (@"^m_") && 
  
!f.IsStatic  
  
// Don't hesitate to customize the regex of NameLike to your preference. 
 && !f.IsGlobal && !f.IsEnumValue && !f.IsThirdParty 
select new { f }).Take(10)

10 fields matched

fieldsFull Name
tokensBackToken.tokensBack
valuesToken.values
_strToken._str
_nextToken._next
_previousToken._previous
_linkToken._link
_scopeToken._scope
_varIdToken._varId
_fileIndexToken._fileIndex
_linenrToken._linenr

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warningCritical    Rule warning: Static fields should be prefixed with a 's_'
// <Name>Static fields should be prefixed with a 's_'</Name>
   warnif count > 0 (from f in Fields where 
  
!f.NameLike (@"^s_") && 
  
f.IsStatic && !f.IsThirdParty 
  
select new { f }).Take(10)  
  
// Don't hesitate to customize the regex of NameLike to your preference.


10 fields matched

fieldsFull Name
TIXML2_MAJOR_VERSION__Globals.TIXML2_MAJOR_VERSION
TIXML2_MINOR_VERSION__Globals.TIXML2_MINOR_VERSION
TIXML2_PATCH_VERSION__Globals.TIXML2_PATCH_VERSION
LINE_FEED__Globals.LINE_FEED
LF__Globals.LF
CARRIAGE_RETURN__Globals.CARRIAGE_RETURN
CR__Globals.CR
SINGLE_QUOTE__Globals.SINGLE_QUOTE
DOUBLE_QUOTE__Globals.DOUBLE_QUOTE
TIXML_UTF_LEAD_0__Globals.TIXML_UTF_LEAD_0

Statistics

Stat
Sum:
Average:
Minimum:
Maximum:
Standard deviation:
Variance:
warningCritical    Rule warning: Exception class name should be suffixed with 'Exception'
// <Name>Exception class name should be suffixed with 'Exception'</Name>
warnif count > 0 (from t in Types where t.IsExceptionClass && !t.NameLike (@"Exception$") && !t.IsThirdParty
select new { t, t.NbLinesOfCode }).Take(10)

1 types matched

type# lines of code (LOC)Full Name
InternalError9InternalError

Statistics

Stat   # lines of code (LOC)
Sum:9
Average:9
Minimum:9
Maximum:9
Standard deviation:0
Variance:0
warningCritical    Rule warning: Types name should begin with an Upper character
// <Name>Types name should begin with an Upper character</Name>
warnif count > 0 (from t in Types where 
 
!t.NameLike (@"^[A-Z]")      // The name of a type should begin with an Upper letter.
  && // Except if it is generated by compiler or ...
 !t.IsThirdParty && !t.IsGlobal
select new { t, t.NbLinesOfCode }).Take(10)

3 types matched

types# lines of code (LOC)Full Name
scopeStackEntryType4anonymous_namespace{tokenize.cpp}.scopeStackEntryType
options11options
givenACodeSampleToTokenize7givenACodeSampleToTokenize

Statistics

Stat   # lines of code (LOC)
Sum:22
Average:7.33
Minimum:4
Maximum:11
Standard deviation:2.87
Variance:8.22
warningCritical    Rule warning: Avoid methods with name too long
// <Name>Avoid methods with name too long</Name>
warnif count > 0 from m in Application.Methods where 
 
!m.IsGeneratedByCompiler 
  
&& m.SimpleName.Length > 35 && !m.IsThirdParty

select new { m, m.SimpleName }

// The regex matches methods with name longer 
// than 35 characters.
// Method Name doesn't contain the type and namespace 
// prefix, FullName does.
// The regex computes the method name length from 
// the beginning until the first open parenthesis 
// or first lower than (for generic methods).
      

81 methods matched

methodsSimpleNameFull Name
checkNullpointerFunctionCallPlausibility(constFunction*,unsignedint)checkNullpointerFunctionCallPlausibility__Globals.checkNullpointerFunctionCallPlausibility(constFunction* ,unsignedint)
concatenateNegativeNumberAndAnyPositive()concatenateNegativeNumberAndAnyPositiveTokenizer.concatenateNegativeNumberAndAnyPositive()
findComplicatedSyntaxErrorsInTemplates()findComplicatedSyntaxErrorsInTemplatesTokenizer.findComplicatedSyntaxErrorsInTemplates()
errorReturnAddressOfFunctionParameter(constToken*,conststd::string&)errorReturnAddressOfFunctionParameterCheckAutoVariables.errorReturnAddressOfFunctionParameter(constToken* ,conststd::string&)
checkComparisonOfBoolExpressionWithInt()checkComparisonOfBoolExpressionWithIntCheckBool.checkComparisonOfBoolExpressionWithInt()
comparisonOfTwoFuncsReturningBoolError(constToken*,conststd::string& ,conststd::string&)comparisonOfTwoFuncsReturningBoolErrorCheckBool.comparisonOfTwoFuncsReturningBoolError(constToken* ,conststd::string&,conststd::string&)
comparisonOfBoolWithInvalidComparator(constToken*,conststd::string&)comparisonOfBoolWithInvalidComparatorCheckBool.comparisonOfBoolWithInvalidComparator(constToken* ,conststd::string&)
comparisonOfBoolExpressionWithIntError(constToken*,bool)comparisonOfBoolExpressionWithIntErrorCheckBool.comparisonOfBoolExpressionWithIntError(constToken*,bool)
operatorEqShouldBeLeftUnimplementedError(constToken*)operatorEqShouldBeLeftUnimplementedErrorCheckClass.operatorEqShouldBeLeftUnimplementedError(constToken*)
operatorEqMissingReturnStatementError(constToken*,bool)operatorEqMissingReturnStatementErrorCheckClass.operatorEqMissingReturnStatementError(constToken*,bool)
getFirstPureVirtualFunctionCallStack(std::map<constFunction*,std::list <constToken*>>&,constToken&,std::list<constToken*>&)getFirstPureVirtualFunctionCallStackCheckClass.getFirstPureVirtualFunctionCallStack(std::map <constFunction*,std::list<constToken*>>&,constToken&,std::list <constToken*>&)
checkComparisonFunctionIsAlwaysTrueOrFalse()checkComparisonFunctionIsAlwaysTrueOrFalseCheckOther.checkComparisonFunctionIsAlwaysTrueOrFalse()
checkComparisonFunctionIsAlwaysTrueOrFalseError(constToken* ,conststd::string&,conststd::string&,constbool)checkComparisonFunctionIsAlwaysTrueOrFalseErrorCheckOther.checkComparisonFunctionIsAlwaysTrueOrFalseError(constToken* ,conststd::string&,conststd::string&,constbool)
redundantBitwiseOperationInSwitchError(constToken*,conststd::string&)redundantBitwiseOperationInSwitchErrorCheckOther.redundantBitwiseOperationInSwitchError(constToken* ,conststd::string&)
alwaysTrueStringVariableCompareError(constToken*,conststd::string& ,conststd::string&)alwaysTrueStringVariableCompareErrorCheckOther.alwaysTrueStringVariableCompareError(constToken* ,conststd::string&,conststd::string&)
alwaysTrueStringVariableCompareError(constToken*,conststd::string& ,conststd::string&)alwaysTrueStringVariableCompareErrorCheckString.alwaysTrueStringVariableCompareError(constToken* ,conststd::string&,conststd::string&)
unhandledExceptionSpecificationError(constToken*const,constToken*const ,conststd::string&)unhandledExceptionSpecificationErrorCheckExceptionSafety.unhandledExceptionSpecificationError (constToken*const,constToken*const,conststd::string&)
wrongPrintfScanfPosixParameterPositionError(constToken* ,conststd::string&,unsignedint,unsignedint)wrongPrintfScanfPosixParameterPositionErrorCheckIO.wrongPrintfScanfPosixParameterPositionError(constToken* ,conststd::string&,unsignedint,unsignedint)
checkFunctionVariableUsage_iterateScopes(constScope*const,Variables& ,bool)checkFunctionVariableUsage_iterateScopesCheckUnusedVar.checkFunctionVariableUsage_iterateScopes (constScope*const,Variables&,bool)
hasComplicatedSyntaxErrorsInTemplates(Token*)hasComplicatedSyntaxErrorsInTemplatesTemplateSimplifier.hasComplicatedSyntaxErrorsInTemplates(Token*)
array_index_same_struct_and_var_name()array_index_same_struct_and_var_nameTestBufferOverrun.array_index_same_struct_and_var_name()
buffer_overrun_function_array_argument()buffer_overrun_function_array_argumentTestBufferOverrun.buffer_overrun_function_array_argument()
assigningPointerToPointerIsNotAConstOperation()assigningPointerToPointerIsNotAConstOperationTestClass.assigningPointerToPointerIsNotAConstOperation()
assigningArrayElementIsNotAConstOperation()assigningArrayElementIsNotAConstOperationTestClass.assigningArrayElementIsNotAConstOperation()
secondAlwaysTrueFalseWhenFirstTrueError()secondAlwaysTrueFalseWhenFirstTrueErrorTestCondition.secondAlwaysTrueFalseWhenFirstTrueError()
testPosixPrintfScanfParameterPosition()testPosixPrintfScanfParameterPositionTestIO.testPosixPrintfScanfParameterPosition()
testMisusedScopeObjectDoesNotPickFunction1()testMisusedScopeObjectDoesNotPickFunction1TestOther.testMisusedScopeObjectDoesNotPickFunction1()
testMisusedScopeObjectDoesNotPickFunction2()testMisusedScopeObjectDoesNotPickFunction2TestOther.testMisusedScopeObjectDoesNotPickFunction2()
testMisusedScopeObjectDoesNotPickConstructorDeclaration()testMisusedScopeObjectDoesNotPickConstructorDeclarationTestOther.testMisusedScopeObjectDoesNotPickConstructorDeclaration()
testMisusedScopeObjectDoesNotPickFunctor()testMisusedScopeObjectDoesNotPickFunctorTestOther.testMisusedScopeObjectDoesNotPickFunctor()
testMisusedScopeObjectDoesNotPickLocalClassConstructors()testMisusedScopeObjectDoesNotPickLocalClassConstructorsTestOther.testMisusedScopeObjectDoesNotPickLocalClassConstructors()
testMisusedScopeObjectDoesNotPickUsedObject()testMisusedScopeObjectDoesNotPickUsedObjectTestOther.testMisusedScopeObjectDoesNotPickUsedObject()
testMisusedScopeObjectDoesNotPickPureC()testMisusedScopeObjectDoesNotPickPureCTestOther.testMisusedScopeObjectDoesNotPickPureC()
testMisusedScopeObjectDoesNotPickNestedClass()testMisusedScopeObjectDoesNotPickNestedClassTestOther.testMisusedScopeObjectDoesNotPickNestedClass()
checkComparisonFunctionIsAlwaysTrueOrFalse()checkComparisonFunctionIsAlwaysTrueOrFalseTestOther.checkComparisonFunctionIsAlwaysTrueOrFalse()
inline_suppression_for_missing_include()inline_suppression_for_missing_includeTestPreprocessor.inline_suppression_for_missing_include()
test_isVariableDeclarationCanHandleNull()test_isVariableDeclarationCanHandleNullTestSymbolDatabase.test_isVariableDeclarationCanHandleNull()
test_isVariableDeclarationIdentifiesSimpleDeclaration()test_isVariableDeclarationIdentifiesSimpleDeclarationTestSymbolDatabase .test_isVariableDeclarationIdentifiesSimpleDeclaration()
test_isVariableDeclarationIdentifiesInitialization()test_isVariableDeclarationIdentifiesInitializationTestSymbolDatabase.test_isVariableDeclarationIdentifiesInitialization( )
test_isVariableDeclarationIdentifiesCpp11Initialization()test_isVariableDeclarationIdentifiesCpp11InitializationTestSymbolDatabase .test_isVariableDeclarationIdentifiesCpp11Initialization()
test_isVariableDeclarationIdentifiesScopedDeclaration()test_isVariableDeclarationIdentifiesScopedDeclarationTestSymbolDatabase .test_isVariableDeclarationIdentifiesScopedDeclaration()
test_isVariableDeclarationIdentifiesStdDeclaration()test_isVariableDeclarationIdentifiesStdDeclarationTestSymbolDatabase.test_isVariableDeclarationIdentifiesStdDeclaration( )
test_isVariableDeclarationIdentifiesScopedStdDeclaration()test_isVariableDeclarationIdentifiesScopedStdDeclarationTestSymbolDatabase .test_isVariableDeclarationIdentifiesScopedStdDeclaration()
test_isVariableDeclarationIdentifiesManyScopes()test_isVariableDeclarationIdentifiesManyScopesTestSymbolDatabase.test_isVariableDeclarationIdentifiesManyScopes()
test_isVariableDeclarationIdentifiesPointers()test_isVariableDeclarationIdentifiesPointersTestSymbolDatabase.test_isVariableDeclarationIdentifiesPointers()
test_isVariableDeclarationDoesNotIdentifyConstness()test_isVariableDeclarationDoesNotIdentifyConstnessTestSymbolDatabase.test_isVariableDeclarationDoesNotIdentifyConstness( )
test_isVariableDeclarationIdentifiesFirstOfManyVariables()test_isVariableDeclarationIdentifiesFirstOfManyVariablesTestSymbolDatabase .test_isVariableDeclarationIdentifiesFirstOfManyVariables()
test_isVariableDeclarationIdentifiesScopedPointerDeclaration()test_isVariableDeclarationIdentifiesScopedPointerDeclarationTestSymbolDatabase .test_isVariableDeclarationIdentifiesScopedPointerDeclaration()
test_isVariableDeclarationIdentifiesDeclarationWithIndirection()test_isVariableDeclarationIdentifiesDeclarationWithIndirectionTestSymbolDatabase .test_isVariableDeclarationIdentifiesDeclarationWithIndirection()
test_isVariableDeclarationIdentifiesDeclarationWithMultipleIndirection ()test_isVariableDeclarationIdentifiesDeclarationWithMultipleIndirectionTestSymbolDatabase .test_isVariableDeclarationIdentifiesDeclarationWithMultipleIndirectio n()
test_isVariableDeclarationIdentifiesArray()test_isVariableDeclarationIdentifiesArrayTestSymbolDatabase.test_isVariableDeclarationIdentifiesArray()
test_isVariableDeclarationIdentifiesOfArrayPointers()test_isVariableDeclarationIdentifiesOfArrayPointersTestSymbolDatabase.test_isVariableDeclarationIdentifiesOfArrayPointers ()
isVariableDeclarationIdentifiesTemplatedPointerVariable()isVariableDeclarationIdentifiesTemplatedPointerVariableTestSymbolDatabase .isVariableDeclarationIdentifiesTemplatedPointerVariable()
isVariableDeclarationIdentifiesTemplatedPointerToPointerVariable()isVariableDeclarationIdentifiesTemplatedPointerToPointerVariableTestSymbolDatabase .isVariableDeclarationIdentifiesTemplatedPointerToPointerVariable()
isVariableDeclarationIdentifiesTemplatedArrayVariable()isVariableDeclarationIdentifiesTemplatedArrayVariableTestSymbolDatabase .isVariableDeclarationIdentifiesTemplatedArrayVariable()
isVariableDeclarationIdentifiesTemplatedVariable()isVariableDeclarationIdentifiesTemplatedVariableTestSymbolDatabase.isVariableDeclarationIdentifiesTemplatedVariable()
isVariableDeclarationIdentifiesTemplatedVariableIterator()isVariableDeclarationIdentifiesTemplatedVariableIteratorTestSymbolDatabase .isVariableDeclarationIdentifiesTemplatedVariableIterator()
isVariableDeclarationIdentifiesNestedTemplateVariable()isVariableDeclarationIdentifiesNestedTemplateVariableTestSymbolDatabase .isVariableDeclarationIdentifiesNestedTemplateVariable()
isVariableDeclarationIdentifiesReference()isVariableDeclarationIdentifiesReferenceTestSymbolDatabase.isVariableDeclarationIdentifiesReference()
isVariableDeclarationDoesNotIdentifyTemplateClass()isVariableDeclarationDoesNotIdentifyTemplateClassTestSymbolDatabase.isVariableDeclarationDoesNotIdentifyTemplateClass()
isVariableDeclarationDoesNotIdentifyCppCast()isVariableDeclarationDoesNotIdentifyCppCastTestSymbolDatabase.isVariableDeclarationDoesNotIdentifyCppCast()
hasRegularFunctionReturningFunctionPointer()hasRegularFunctionReturningFunctionPointerTestSymbolDatabase.hasRegularFunctionReturningFunctionPointer()
hasInlineClassFunctionReturningFunctionPointer()hasInlineClassFunctionReturningFunctionPointerTestSymbolDatabase.hasInlineClassFunctionReturningFunctionPointer()
hasMissingInlineClassFunctionReturningFunctionPointer()hasMissingInlineClassFunctionReturningFunctionPointerTestSymbolDatabase .hasMissingInlineClassFunctionReturningFunctionPointer()
hasClassFunctionReturningFunctionPointer()hasClassFunctionReturningFunctionPointerTestSymbolDatabase.hasClassFunctionReturningFunctionPointer()
canFindMatchingBracketsWithTooManyClosing()canFindMatchingBracketsWithTooManyClosingTestToken.canFindMatchingBracketsWithTooManyClosing()
canFindMatchingBracketsWithTooManyOpening()canFindMatchingBracketsWithTooManyOpeningTestToken.canFindMatchingBracketsWithTooManyOpening()
simplifyKnownVariablesBailOutAssign1()simplifyKnownVariablesBailOutAssign1TestTokenizer.simplifyKnownVariablesBailOutAssign1()
simplifyKnownVariablesBailOutAssign2()simplifyKnownVariablesBailOutAssign2TestTokenizer.simplifyKnownVariablesBailOutAssign2()
simplifyKnownVariablesBailOutAssign3()simplifyKnownVariablesBailOutAssign3TestTokenizer.simplifyKnownVariablesBailOutAssign3()
simplifyKnownVariablesBailOutMemberFunction()simplifyKnownVariablesBailOutMemberFunctionTestTokenizer.simplifyKnownVariablesBailOutMemberFunction()
simplifyKnownVariablesBailOutConditionalIncrement()simplifyKnownVariablesBailOutConditionalIncrementTestTokenizer.simplifyKnownVariablesBailOutConditionalIncrement()
simplifyKnownVariablesBailOutSwitchBreak()simplifyKnownVariablesBailOutSwitchBreakTestTokenizer.simplifyKnownVariablesBailOutSwitchBreak()
simplifyMathFunctions_isgreaterequal()simplifyMathFunctions_isgreaterequalTestTokenizer.simplifyMathFunctions_isgreaterequal()
testDoesNotIdentifyMethodAsFirstFunctionArgument()testDoesNotIdentifyMethodAsFirstFunctionArgumentTestUnusedPrivateFunction .testDoesNotIdentifyMethodAsFirstFunctionArgument()
testDoesNotIdentifyMethodAsMiddleFunctionArgument()testDoesNotIdentifyMethodAsMiddleFunctionArgumentTestUnusedPrivateFunction .testDoesNotIdentifyMethodAsMiddleFunctionArgument()
testDoesNotIdentifyMethodAsLastFunctionArgument()testDoesNotIdentifyMethodAsLastFunctionArgumentTestUnusedPrivateFunction .testDoesNotIdentifyMethodAsLastFunctionArgument()
valueFlowBeforeConditionAssignIncDec()valueFlowBeforeConditionAssignIncDecTestValueFlow.valueFlowBeforeConditionAssignIncDec()
valueFlowBeforeConditionAndAndOrOrGuard()valueFlowBeforeConditionAndAndOrOrGuardTestValueFlow.valueFlowBeforeConditionAndAndOrOrGuard()
valueFlowBeforeConditionFunctionCall()valueFlowBeforeConditionFunctionCallTestValueFlow.valueFlowBeforeConditionFunctionCall()
valueFlowBeforeConditionGlobalVariables()valueFlowBeforeConditionGlobalVariablesTestValueFlow.valueFlowBeforeConditionGlobalVariables()

Statistics

Stat   SimpleName
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Rule warning: Namespace name should correspond to file location
// <Name>Namespace name should correspond to file location</Name>

// For a good code organization, 
// do mirror the namespaces hierarchy and the source files directories tree.

warnif count > 0
from n in Application.Namespaces 

// Replace dots by spaces in namespace name
let dirCorresponding = n.Name.Replace('.', ' ')

// Look at source file decl of JustMyCode type's declared in n
from t in n.ChildTypes
where JustMyCode.Contains(t) 
from decl in t.SourceDecls
let sourceFilePath = decl.SourceFile.FilePath.ToString()

// Replace dots and path separators by spaces in source files names
where !sourceFilePath.Replace('.',' ').Replace('\\',' ').Contains(dirCorresponding) && !t.IsThirdParty

select new { t, dirCorresponding , sourceFilePath  } 

81 types matched

typesdirCorrespondingsourceFilePathFull Name
__Globalstinyxml2c:\GlobalMemberstinyxml2.__Globals
ValueValueFlowC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.hValueFlow.Value
__GlobalsValueFlowc:\GlobalMembersValueFlow.__Globals
__Globalsanonymous_namespace{check64bit cpp}c:\GlobalMembersanonymous_namespace{check64bit.cpp}.__Globals
__Globalsanonymous_namespace{checkassert cpp}c:\GlobalMembersanonymous_namespace{checkassert.cpp}.__Globals
__Globalsanonymous_namespace{checkautovariables cpp}c:\GlobalMembersanonymous_namespace{checkautovariables.cpp}.__Globals
__Globalsanonymous_namespace{checkbool cpp}c:\GlobalMembersanonymous_namespace{checkbool.cpp}.__Globals
__Globalsanonymous_namespace{checkboost cpp}c:\GlobalMembersanonymous_namespace{checkboost.cpp}.__Globals
__Globalsanonymous_namespace{checkbufferoverrun cpp}c:\GlobalMembersanonymous_namespace{checkbufferoverrun.cpp}.__Globals
__Globalsanonymous_namespace{checkclass cpp}c:\GlobalMembersanonymous_namespace{checkclass.cpp}.__Globals
__Globalsanonymous_namespace{checkcondition cpp}c:\GlobalMembersanonymous_namespace{checkcondition.cpp}.__Globals
__Globalsanonymous_namespace{checkstring cpp}c:\GlobalMembersanonymous_namespace{checkstring.cpp}.__Globals
__Globalsanonymous_namespace{checkexceptionsafety cpp}c:\GlobalMembersanonymous_namespace{checkexceptionsafety.cpp}.__Globals
__Globalsanonymous_namespace{checkio cpp}c:\GlobalMembersanonymous_namespace{checkio.cpp}.__Globals
__Globalsanonymous_namespace{checkleakautovar cpp}c:\GlobalMembersanonymous_namespace{checkleakautovar.cpp}.__Globals
__Globalsanonymous_namespace{checkmemoryleak cpp}c:\GlobalMembersanonymous_namespace{checkmemoryleak.cpp}.__Globals
__Globalsanonymous_namespace{checknonreentrantfunctions cpp}c:\GlobalMembersanonymous_namespace{checknonreentrantfunctions.cpp}.__Globals
__Globalsanonymous_namespace{checknullpointer cpp}c:\GlobalMembersanonymous_namespace{checknullpointer.cpp}.__Globals
__Globalsanonymous_namespace{checkobsolescentfunctions cpp}c:\GlobalMembersanonymous_namespace{checkobsolescentfunctions.cpp}.__Globals
__Globalsanonymous_namespace{checkother cpp}c:\GlobalMembersanonymous_namespace{checkother.cpp}.__Globals
__Globalsanonymous_namespace{checkpostfixoperator cpp}c:\GlobalMembersanonymous_namespace{checkpostfixoperator.cpp}.__Globals
__Globalsanonymous_namespace{checksizeof cpp}c:\GlobalMembersanonymous_namespace{checksizeof.cpp}.__Globals
__Globalsanonymous_namespace{checkstl cpp}c:\GlobalMembersanonymous_namespace{checkstl.cpp}.__Globals
__Globalsanonymous_namespace{checktype cpp}c:\GlobalMembersanonymous_namespace{checktype.cpp}.__Globals
__Globalsanonymous_namespace{checkuninitvar cpp}c:\GlobalMembersanonymous_namespace{checkuninitvar.cpp}.__Globals
__Globalsanonymous_namespace{checkunusedvar cpp}c:\GlobalMembersanonymous_namespace{checkunusedvar.cpp}.__Globals
__Globalsanonymous_namespace{checkvaarg cpp}c:\GlobalMembersanonymous_namespace{checkvaarg.cpp}.__Globals
__Globalsanonymous_namespace{timer cpp}c:\GlobalMembersanonymous_namespace{timer.cpp}.__Globals
scopeStackEntryTypeanonymous_namespace{tokenize cpp}C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cppanonymous_namespace{tokenize.cpp}.scopeStackEntryType
__Globalsanonymous_namespace{test64bit cpp}c:\GlobalMembersanonymous_namespace{test64bit.cpp}.__Globals
__Globalsanonymous_namespace{testassert cpp}c:\GlobalMembersanonymous_namespace{testassert.cpp}.__Globals
__Globalsanonymous_namespace{testautovariables cpp}c:\GlobalMembersanonymous_namespace{testautovariables.cpp}.__Globals
__Globalsanonymous_namespace{testbool cpp}c:\GlobalMembersanonymous_namespace{testbool.cpp}.__Globals
__Globalsanonymous_namespace{testboost cpp}c:\GlobalMembersanonymous_namespace{testboost.cpp}.__Globals
__Globalsanonymous_namespace{testbufferoverrun cpp}c:\GlobalMembersanonymous_namespace{testbufferoverrun.cpp}.__Globals
__Globalsanonymous_namespace{testcharvar cpp}c:\GlobalMembersanonymous_namespace{testcharvar.cpp}.__Globals
__Globalsanonymous_namespace{testclass cpp}c:\GlobalMembersanonymous_namespace{testclass.cpp}.__Globals
__Globalsanonymous_namespace{testcmdlineparser cpp}c:\GlobalMembersanonymous_namespace{testcmdlineparser.cpp}.__Globals
__Globalsanonymous_namespace{testcondition cpp}c:\GlobalMembersanonymous_namespace{testcondition.cpp}.__Globals
__Globalsanonymous_namespace{testconstructors cpp}c:\GlobalMembersanonymous_namespace{testconstructors.cpp}.__Globals
__Globalsanonymous_namespace{testcppcheck cpp}c:\GlobalMembersanonymous_namespace{testcppcheck.cpp}.__Globals
__Globalsanonymous_namespace{testerrorlogger cpp}c:\GlobalMembersanonymous_namespace{testerrorlogger.cpp}.__Globals
__Globalsanonymous_namespace{testexceptionsafety cpp}c:\GlobalMembersanonymous_namespace{testexceptionsafety.cpp}.__Globals
__Globalsanonymous_namespace{testfilelister cpp}c:\GlobalMembersanonymous_namespace{testfilelister.cpp}.__Globals
__Globalsanonymous_namespace{testgarbage cpp}c:\GlobalMembersanonymous_namespace{testgarbage.cpp}.__Globals
__Globalsanonymous_namespace{testincompletestatement cpp}c:\GlobalMembersanonymous_namespace{testincompletestatement.cpp}.__Globals
__Globalsanonymous_namespace{testio cpp}c:\GlobalMembersanonymous_namespace{testio.cpp}.__Globals
__Globalsanonymous_namespace{testleakautovar cpp}c:\GlobalMembersanonymous_namespace{testleakautovar.cpp}.__Globals
__Globalsanonymous_namespace{testlibrary cpp}c:\GlobalMembersanonymous_namespace{testlibrary.cpp}.__Globals
__Globalsanonymous_namespace{testmathlib cpp}c:\GlobalMembersanonymous_namespace{testmathlib.cpp}.__Globals
__Globalsanonymous_namespace{testmemleak cpp}c:\GlobalMembersanonymous_namespace{testmemleak.cpp}.__Globals
__Globalsanonymous_namespace{testnonreentrantfunctions cpp}c:\GlobalMembersanonymous_namespace{testnonreentrantfunctions.cpp}.__Globals
__Globalsanonymous_namespace{testnullpointer cpp}c:\GlobalMembersanonymous_namespace{testnullpointer.cpp}.__Globals
__Globalsanonymous_namespace{testobsolescentfunctions cpp}c:\GlobalMembersanonymous_namespace{testobsolescentfunctions.cpp}.__Globals
__Globalsanonymous_namespace{testoptions cpp}c:\GlobalMembersanonymous_namespace{testoptions.cpp}.__Globals
__Globalsanonymous_namespace{testother cpp}c:\GlobalMembersanonymous_namespace{testother.cpp}.__Globals
__Globalsanonymous_namespace{testpath cpp}c:\GlobalMembersanonymous_namespace{testpath.cpp}.__Globals
__Globalsanonymous_namespace{testpathmatch cpp}c:\GlobalMembersanonymous_namespace{testpathmatch.cpp}.__Globals
__Globalsanonymous_namespace{testpostfixoperator cpp}c:\GlobalMembersanonymous_namespace{testpostfixoperator.cpp}.__Globals
__Globalsanonymous_namespace{testpreprocessor cpp}c:\GlobalMembersanonymous_namespace{testpreprocessor.cpp}.__Globals
__Globalsanonymous_namespace{testsamples cpp}c:\GlobalMembersanonymous_namespace{testsamples.cpp}.__Globals
__Globalsanonymous_namespace{testsimplifytemplate cpp}c:\GlobalMembersanonymous_namespace{testsimplifytemplate.cpp}.__Globals
__Globalsanonymous_namespace{testsimplifytokens cpp}c:\GlobalMembersanonymous_namespace{testsimplifytokens.cpp}.__Globals
__Globalsanonymous_namespace{testsimplifytypedef cpp}c:\GlobalMembersanonymous_namespace{testsimplifytypedef.cpp}.__Globals
__Globalsanonymous_namespace{testsizeof cpp}c:\GlobalMembersanonymous_namespace{testsizeof.cpp}.__Globals
__Globalsanonymous_namespace{teststl cpp}c:\GlobalMembersanonymous_namespace{teststl.cpp}.__Globals
__Globalsanonymous_namespace{teststring cpp}c:\GlobalMembersanonymous_namespace{teststring.cpp}.__Globals
__Globalsanonymous_namespace{testsuppressions cpp}c:\GlobalMembersanonymous_namespace{testsuppressions.cpp}.__Globals
__Globalsanonymous_namespace{testsymboldatabase cpp}c:\GlobalMembersanonymous_namespace{testsymboldatabase.cpp}.__Globals
__Globalsanonymous_namespace{testthreadexecutor cpp}c:\GlobalMembersanonymous_namespace{testthreadexecutor.cpp}.__Globals
__Globalsanonymous_namespace{testtimer cpp}c:\GlobalMembersanonymous_namespace{testtimer.cpp}.__Globals
__Globalsanonymous_namespace{testtoken cpp}c:\GlobalMembersanonymous_namespace{testtoken.cpp}.__Globals
__Globalsanonymous_namespace{testtokenize cpp}c:\GlobalMembersanonymous_namespace{testtokenize.cpp}.__Globals
__Globalsanonymous_namespace{testtype cpp}c:\GlobalMembersanonymous_namespace{testtype.cpp}.__Globals
__Globalsanonymous_namespace{testuninitvar cpp}c:\GlobalMembersanonymous_namespace{testuninitvar.cpp}.__Globals
__Globalsanonymous_namespace{testunusedfunctions cpp}c:\GlobalMembersanonymous_namespace{testunusedfunctions.cpp}.__Globals
__Globalsanonymous_namespace{testunusedprivfunc cpp}c:\GlobalMembersanonymous_namespace{testunusedprivfunc.cpp}.__Globals
__Globalsanonymous_namespace{testunusedvar cpp}c:\GlobalMembersanonymous_namespace{testunusedvar.cpp}.__Globals
__Globalsanonymous_namespace{testvaarg cpp}c:\GlobalMembersanonymous_namespace{testvaarg.cpp}.__Globals
__Globalsanonymous_namespace{testvalueflow cpp}c:\GlobalMembersanonymous_namespace{testvalueflow.cpp}.__Globals
__Globalsanonymous_namespace{testvarid cpp}c:\GlobalMembersanonymous_namespace{testvarid.cpp}.__Globals

Statistics

Stat   dirCorresponding   sourceFilePath
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00

040
Source Files Organization  

warningCritical    Rule warning: Avoid defining multiple types in a source file
// <Name>Avoid defining multiple types in a source file</Name>
warnif count > 0 

// Build a lookup indexed by source files, values being a sequence of types defined in the source file.
let lookup = Application.Types.Where(t => 
                                
!t.IsGlobal && 
                               
// except nested types and types generated by compilers!
                               !t.IsGeneratedByCompiler &&                               
                               
!t.IsNested)                                
                         
// It could make sense to not apply this rule for enumerations.
                         // && !t.IsEnumeration)

            
// We use multi-key, since a type can be declared in multiple source files.
           .ToMultiKeyLookup(t => t.SourceDecls.Select(d => d.SourceFile))
 
from @group in lookup where @group.Count() > 1
   
let sourceFile = @group.Key

   
// CQLinq doesn't let indexing result with sourceFile 
   // so we choose a typeIndex in types, 
   // preferably the type that has the file name.
   let typeWithSourceFileName = @group.FirstOrDefault(t => t.SimpleName == sourceFile.FileNameWithoutExtension)
   
let typeIndex = typeWithSourceFileName ?? @group.First()

select new { typeIndex, 
             
types = @group as IEnumerable<IType>, 
             
sourceFile.FilePathString }

16 types matched

typestypesFilePathStringFull Name
InternalError3 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\errorlogger.hInternalError
SHOWTIME_MODES5 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\timer.hSHOWTIME_MODES
AccessControl7 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\symboldatabase.hAccessControl
OpenMode2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkio.cppOpenMode
VarInfo2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkleakautovar.hVarInfo
CheckMemoryLeak5 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\checkmemoryleak.hCheckMemoryLeak
Space3 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cppSpace
StrPair19 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\externals\tinyxml\tinyxml2.htinyxml2.StrPair
CmdLineParser2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cmdlineparser.hCmdLineParser
CppCheckExecutor2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cppcheckexecutor.hCppCheckExecutor
FileLister2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\filelister.hFileLister
PathMatch2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\pathmatch.hPathMatch
ThreadExecutor2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\threadexecutor.hThreadExecutor
IMAGEHLP_SYMBOL64_EXT2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\cppcheckexecutor.cppIMAGEHLP_SYMBOL64_EXT
TestMemleak7 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\test\testmemleak.cppTestMemleak
givenACodeSampleToTokenize2 typesC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\test\testutils.hgivenACodeSampleToTokenize

Statistics

Stat   types   FilePathString
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Rule warning: Namespace name should correspond to file location
// <Name>Namespace name should correspond to file location</Name>

// For a good code organization, 
// do mirror the namespaces hierarchy and the source files directories tree.

warnif count > 0
from n in Application.Namespaces 

// Replace dots by spaces in namespace name
let dirCorresponding = n.Name.Replace('.', ' ')

// Look at source file decl of JustMyCode type's declared in n
from t in n.ChildTypes
where JustMyCode.Contains(t) && !t.IsGlobal
from decl in t.SourceDecls
let sourceFilePath = decl.SourceFile.FilePath.ToString()

// Replace dots and path separators by spaces in source files names
where !sourceFilePath.Replace('.',' ').Replace('\\',' ').Contains(dirCorresponding)

select new { t, dirCorresponding , sourceFilePath  } 

2 types matched

typesdirCorrespondingsourceFilePathFull Name
ValueValueFlowC:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\valueflow.hValueFlow.Value
scopeStackEntryTypeanonymous_namespace{tokenize cpp}C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\lib\tokenize.cppanonymous_namespace{tokenize.cpp}.scopeStackEntryType

Statistics

Stat   dirCorresponding   sourceFilePath
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
warningCritical    Rule warning: Types with source files stored in the same directory, should be declared in the same namespace
// <Name>Types with source files stored in the same directory, should be declared in the same namespace</Name>
warnif count > 0 

// Group JustMyCode types in a lookup 
// where groups are keyed with directories that contain the types' source file(s).
// Note that a type can be contained in several groups 
// if it is declared in several source files stored in different directories.
let lookup = JustMyCode.Types.Where(t => !t.IsGlobal)
            
.ToMultiKeyLookup(
               
t => t.SourceDecls.Select(
                          
decl => decl.SourceFile.FilePath.ParentDirectoryPath).Distinct()
            
)


from groupOfTypes in lookup
let parentNamespaces = groupOfTypes.ParentNamespaces()

// Select group of types (with source files stored in the same directory) ...
// ... but contained in several namespaces
where parentNamespaces.Count() > 1

// mainNamespaces is the namespace that contains many types 
// declared in the directory groupOfTypes .key
let mainNamespace  = groupOfTypes
                     
.ToLookup(t => t.ParentNamespace)
                     
.OrderByDescending(g => g.Count()).First().Key

// Select types with source files stored in the same directory,
// but contained in namespaces different than mainNamespace.
let typesOutOfMainNamespace = groupOfTypes
                              
.Where(t => t.ParentNamespace != mainNamespace )

                               
// Filter types declared on several source files that contain generated methods 
                               // because typically such type contains one or several partial definitions generated.
                               // These partially generated types would be false positive for the present rule.
                               .Where(t => t.SourceDecls.Count() == 1 ||
                                           
t.Methods.Count(m => JustMyCode.Contains(m)) == 0)
where typesOutOfMainNamespace.Count() > 0

select new { mainNamespace, 

             
// Typically a type in typesOutOfMainNamespace ...
             // 1) ... is contained in the wrong namespace but its source file(s) is stored in the right directory.
             //      --> In such situation the type should be contained in mainNamespace.
             // 2) ... is contained in the right namespace but its source file(s) is stored in the wrong directory
             //      --> In such situation the source file of type must be moved to the parent namespace directory.
             // 3) ... is declared in multiple source files, stored in different directories.
             //      --> It would be preferable that all source files are stored in a single directory.
             typesOutOfMainNamespace   }

2 namespaces matched

namespacestypesOutOfMainNamespaceFull Name
2 types
7 types

Statistics

Stat   typesOutOfMainNamespace
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
warningCritical    Rule warning: Types declared in the same namespace, should have their source files stored in the same directory
// <Name>Types declared in the same namespace, should have their source files stored in the same directory</Name>
warnif count > 0 
from @namespace in Application.Namespaces

// Group types of @namespace in a lookup 
// where groups are keyed with directories that contain the types' source file(s).
// Note that a type can be contained in several groups 
// if it is declared in several source files stored in different directories.
let lookup = @namespace.ChildTypes.Where(t => !t.IsGlobal && JustMyCode.Contains(t))
            
.ToMultiKeyLookup(
               
t => t.SourceDecls.Select(
                          
decl => decl.SourceFile.FilePath.ParentDirectoryPath).Distinct()
            
)

// Are types of @namespaces declared in more than one directory?
where lookup.Count > 1

// Infer the main directory, preferably the one that has the same name as the namespace.
let dirs = lookup.Select(types => types.Key)
let mainDirNullable = dirs.Where(d => d.DirectoryName == @namespace.SimpleName).FirstOrDefault()
let mainDir = mainDirNullable ?? dirs.First()

// Types declared out of mainDir, are types in group of types declared in a directory different than mainDir!
let typesDeclaredOutOfMainDir = lookup.Where(types => types.Key != mainDir)
                                
.SelectMany(types => types)
                                
                                
// Filter types declared on several source files that contain generated methods 
                                // because typically such type contains one or several partial definitions generated.
                                // These partially generated types would be false positive for the present rule.
                                .Where(t => t.SourceDecls.Count() == 1 ||
                                            
t.Methods.Count(m => JustMyCode.Contains(m)) == 0)

where typesDeclaredOutOfMainDir.Count() > 0

select new { @namespace, 

             
// Typically a type in typesDeclaredOutOfMainDir ...
             // 1) ... is contained in the wrong namespace but its source file(s) is stored in the right directory.
             //      --> In such situation the type parent namespace should be the namespace corresponding to the directory.
             // 2) ... is contained in the right namespace but its source file(s) is stored in the wrong directory
             //      --> In such situation the type source file should be moved to mainDir.
             // 3) ... is declared in multiple source files, stored in different directories.
             //      --> It would be preferable that all source files are stored in a single directory.
             typesDeclaredOutOfMainDir , 

             
mainDir = mainDir.ToString() }

3 namespaces matched

namespacestypesDeclaredOutOfMainDirmainDirFull Name
120 typesc:
7 typesc:
73 typesc:

Statistics

Stat   typesDeclaredOutOfMainDir   mainDir
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00

Object Oriented Design

Base class should not use derivatives
• Rule Description:

In Object-Oriented Programming, the open/closed principle states: software entities (components, classes, methods, etc.) should be open for extension, but closed for modification. http://en.wikipedia.org/wiki/Open/closed_principle

Hence a base class should be designed properly to make it easy to derive from, this is extension. But creating a new derived class, or modifying an existing one, shouldn't provoke any modification in the base class. And if a base class is using some derivative classes somehow, there are good chances that such modification will be needed.

Extending the base class is not anymore a simple operation, this is not good design.


• How to Fix Violations:

Understand the need for using derivatives, then imagine a new design, and then refactor.

Typically an algorithm in the base class needs to access something from derived classes. You can try to encapsulate this access behind an abstract or a virtual method.

If you see in the base class some conditions on typeof(DerivedClass) not only urgent refactoring is needed. Such condition can easily be replaced through an abstract or a virtual method.

Sometime you'll see a base class that creates instance of some derived classes. In such situation, certainly using the factory method pattern http://en.wikipedia.org/wiki/Factory_method_pattern or the abstract factory pattern http://en.wikipedia.org/wiki/Abstract_factory_pattern will improve the design.

1 types matched

typederivedClassesUsedFull Name
XMLNode6 typestinyxml2.XMLNode

Statistics

Stat   derivedClassesUsed
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
Class shouldn't be too deep in inheritance tree
• Rule Description:

This rule warns about classes having 3 or more base classes. Notice that third-party base classes are not counted because this rule is about your code design, not third-party libraries consumed design.

In theory, there is nothing wrong having a long inheritance chain, if the modelization has been well thought out, if each base class is a well-designed refinement of the domain.

In practice, modeling properly a domain demands a lot of effort and experience and more often than not, a long inheritance chain is a sign of confused design, that will be hard to work with and maintain.


• How to Fix Violations:

In Object-Oriented Programming, a well-known motto is Favor Composition over Inheritance.

This is because inheritance comes with pitfalls. In general, the implementation of a derived class is very bound up with the base class implementation. Also a base class exposes implementation details to its derived classes, that's why it's often said that inheritance breaks encapsulation.

On the other hands, Composition favors binding with interfaces over binding with implementations. Hence, not only the encapsulation is preserved, but the design is clearer, because interfaces make it explicit and less coupled.

Hence, to break a long inheritance chain, Composition is often a powerful way to enhance the design of the refactored underlying logic.

You can also read: http://en.wikipedia.org/wiki/Composition_over_inheritance and http://stackoverflow.com/questions/49002/prefer-composition-over-inheritance

No types matched

Constructor should not call a virtual methods
// <Name>Constructor should not call a virtual methods</Name>

// Returns constructor of a non-sealed type calling virtual methods.
// In such a situation, if a derived class overrides the method,
// then the override method will be called before the derived constructor.
// This makes the class fragile to derive from.
//
// Violations reported can be solved by re-designing object initialisation
// or by marking the parent class as sealed, if possible.

warnif count > 0
from t in Application.Types where 
   
t.IsClass &&
  
!t.IsGeneratedByCompiler

from ctor in t.Constructors 
let virtualMethodsCalled = from mCalled in ctor.MethodsCalled
                           
where mCalled.IsVirtual &&
                                
(mCalled.ParentType == t ||
                                 
t.DeriveFrom(mCalled.ParentType))
                           
select mCalled
where virtualMethodsCalled.Count() > 0

select new { ctor , 
             
virtualMethodsCalled, 
             
// If there is no derived type, it might be 
             // an opportunity to mark t as sealed.
             t.DerivedTypes }

1 methods matched

methodvirtualMethodsCalledDerivedTypesFull Name
SymbolDatabase(constTokenizer*,constSettings*,ErrorLogger*)1 method0 typeSymbolDatabase.SymbolDatabase(constTokenizer*,constSettings* ,ErrorLogger*)

Statistics

Stat   virtualMethodsCalled   DerivedTypes
Sum:00
Average:00
Minimum:00
Maximum:00
Standard deviation:00
Variance:00
Avoid the Singleton pattern
//<Name>Avoid the Singleton pattern</Name>
warnif count > 0
from t in Application.Types
where !t.IsStatic && !t.IsAbstract && (t.IsClass || t.IsStructure)

// All ctors of a singleton are private
where t.Constructors.Where(ctor => !ctor.IsPrivate).Count() == 0

// A singleton contains one static field of its parent type, to reference the unique instance
let staticFieldInstances = t.StaticFields.WithFieldType(t)
where staticFieldInstances.Count() == 1
select new { t, staticFieldInstance = staticFieldInstances.First() }

// The Singleton pattern consists in syntactically enforcing that a class 
// has just one unique instance.
// At first glance, this pattern looks appealing and it is widely used.
// However, we discourage you from using singleton classes because experience
// shows that singletons often result in less testable and less maintainable code.
// More details available in these discussions:
//  http://codebetter.com/patricksmacchia/2011/05/04/back-to-basics-usage-of-static-members/
//  http://adamschepis.com/blog/2011/05/02/im-adam-and-im-a-recovering-singleton-addict/

No types matched

Don't assign static fields from instance methods
• Rule Description:

Assigning static fields from instance methods leads to poorly maintainable and non-thread-safe code.

More discussion on the topic can be found here: http://codebetter.com/patricksmacchia/2011/05/04/back-to-basics-usage-of-static-members/


• How to Fix Violations:

If the static field is just assigned once in the program lifetime, make sure to declare it as readonly and assign it inline, or from the static constructor.

In Object-Oriented-Programming the natural artifact to hold states that can be modified is instance fields.

Hence to fix violations of this rule, make sure to hold assignable states through instance fields, not through static fields.

3 fields matched

fieldsassignedByFull Name
macroChar5 methodsPreprocessor.macroChar
missingIncludeFlag5 methodsPreprocessor.missingIncludeFlag
missingSystemIncludeFlag3 methodsPreprocessor.missingSystemIncludeFlag

Statistics

Stat   assignedBy
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0
Avoid Abstract Classes with too many methods
// <Name>Avoid Abstract Classes with too many methods</Name>
// An abstract class  should abstract a clear and well-defined concept.
// Such concept shoudln't be represented with too many methods and property getter.
warnif count > 0 from t in JustMyCode.Types where 
  
t.IsAbstract
let methodsAndGetters = t.Methods
where methodsAndGetters.Count() > 10
select new { t, methodsAndGetters }

4 types matched

typesmethodsAndGettersFull Name
Check16 methodsCheck
ExecutionPath13 methodsExecutionPath
XMLNode49 methodstinyxml2.XMLNode
TestFixture23 methodsTestFixture

Statistics

Stat   methodsAndGetters
Sum:0
Average:0
Minimum:0
Maximum:0
Standard deviation:0
Variance:0

API Breaking Changes

API Breaking Changes: Types
// <Name>API Breaking Changes: Types</Name>
// This rule warns if a publicly visible type is 
// not publicly visible anymore or if it has been removed.
// Such type can break the code of your clients.

warnif count > 0 from t in codeBase.OlderVersion().Application.Types
where t.IsPublic && 

     
// The type has been removed and its parent project hasn't been removed ...
     ( (t.WasRemoved() && !t.ParentProject.WasRemoved()) ||

     
// ... or the type is not publicly visible anymore
       !t.WasRemoved() && !t.NewerVersion().IsPublic)

select new { t,
             
NewVisibility = (t.WasRemoved() ? " " : t.NewerVersion().Visibility.ToString()) }

No types matched

API Breaking Changes: Methods
// <Name>API Breaking Changes: Methods</Name>
// This rule warns if a publicly visible method is 
// not publicly visible anymore or if it has been removed.
// Such method can break the code of your clients.

warnif count > 0 from m in codeBase.OlderVersion().Application.Methods
where m.IsPublic && 

     
// The method has been removed and its parent type hasn't been removed ...
     ( (m.WasRemoved() && !m.ParentType.WasRemoved()) ||

     
// ... or the method is not publicly visible anymore
       !m.WasRemoved() && !m.NewerVersion().IsPublic)

select new { m,
             
NewVisibility = (m.WasRemoved() ? " " : m.NewerVersion().Visibility.ToString()) }

No methods matched

API Breaking Changes: Fields
// <Name>API Breaking Changes: Fields</Name>
// This rule warns if a publicly visible field is 
// not publicly visible anymore or if it has been removed.
// Such field can break the code of your clients.

warnif count > 0 from f in codeBase.OlderVersion().Application.Fields
where f.IsPublic &&

     
// The field has been removed and its parent type hasn't been removed ...
     ( (f.WasRemoved() && !f.ParentType.WasRemoved()) ||

     
// ... or the field is not publicly visible anymore
       !f.WasRemoved() && !f.NewerVersion().IsPublic)

select new { f,
             
NewVisibility = (f.WasRemoved() ? " " : f.NewerVersion().Visibility.ToString()) }

No fields matched

API Breaking Changes: Interfaces and Abstract Classes
// <Name>API Breaking Changes: Interfaces and Abstract Classes</Name>
// This rule warns if a publicly visible interface or abstract class 
// has been changed and contains new abstract methods or 
// if some abstract methods have been removed.
// This can break the code of clients 
// that implement such interface or derive from such abstract class.

warnif count > 0 from tNewer in Application.Types where 
 
(tNewer.IsInterface || tNewer.IsClass && tNewer.IsAbstract) && 
  
tNewer.IsPublic && 
  
tNewer.IsPresentInBothBuilds()

let tOlder = tNewer.OlderVersion() where tOlder.IsPublic

let methodsRemoved = tOlder.Methods.Where(m => m.IsAbstract && m.WasRemoved())
let methodsAdded = tNewer.Methods.Where(m => m.IsAbstract && m.WasAdded())

where methodsAdded.Count() > 0 || methodsRemoved.Count() > 0
select new { tNewer, methodsAdded, methodsRemoved }

No types matched

Avoid transforming immutable types into mutable types
// <Name>Avoid transforming immutable types into mutable types</Name>

// Immutability is a strong property on a type.
// Breaking immutability can result in serious problem for an algorithm consummer
// that has been written taking account of the type immutability.

// To visualize changes in code, right-click a matched type and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

warnif count > 0 
from t in Application.Types where
  
t.IsPresentInBothBuilds() &&
 
!t.IsStatic &&
 
!t.IsImmutable && 
  
t.OlderVersion().IsImmutable

let mutableFields = from f in t.InstanceFields where !f.IsImmutable select f

select new { t, mutableFields }

No types matched

API: New publicly visible types
// <Name>API: New publicly visible types</Name>
// List types that are new in the public surface of your Projects

from t in Application.Types
where t.IsPublic && 

     
// The type has been removed and its parent project hasn't been removed ...
     ( (t.WasAdded() && !t.ParentProject.WasAdded()) ||

     
// ... or the type existed but was not publicly visible
       !t.WasAdded() && !t.OlderVersion().IsPublic)

select new { t,
             
OldVisibility = (t.WasAdded() ? " " : t.OlderVersion().Visibility.ToString()) }

No types matched

API: New publicly visible methods
// <Name>API: New publicly visible methods</Name>
// List methods that are new in the public surface of your Projects

from m in Application.Methods
where m.IsPublic && 

     
// The method has been removed and its parent project hasn'm been removed ...
     ( (m.WasAdded() && !m.ParentType.WasAdded()) ||

     
// ... or the t existed but was not publicly visible
       !m.WasAdded() && !m.OlderVersion().IsPublic)

select new { m,
             
OldVisibility = (m.WasAdded() ? " " : m.OlderVersion().Visibility.ToString()) }

No methods matched

API: New publicly visible fields
// <Name>API: New publicly visible fields</Name>
// List fields that are new in the public surface of your Projects

from f in Application.Fields
where f.IsPublic && 

     
// The method has been removed and its parent project hasn'f been removed ...
     ( (f.WasAdded() && !f.ParentType.WasAdded()) ||

     
// ... or the t existed but was not publicly visible
       !f.WasAdded() && !f.OlderVersion().IsPublic)

select new { f,
             
OldVisibility = (f.WasAdded() ? " " : f.OlderVersion().Visibility.ToString()) }

No fields matched

Code Diff Summary

New Projects
// <Name>New Projects</Name>
from a in Application.Projects where a.WasAdded()
select new { a, a.NbLinesOfCode }

No projects matched

Projects removed
// <Name>Projects removed</Name>
from a in codeBase.OlderVersion().Application.Projects where a.WasRemoved()
select new { a, a.NbLinesOfCode }

No projects matched

Projects where code was changed
// <Name>Projects where code was changed</Name>
from a in Application.Projects where a.CodeWasChanged()
select new { a, a.NbLinesOfCode, 
             
oldNbLinesOfCode = a.OlderVersion().NbLinesOfCode ,
             
delta = (int) a.NbLinesOfCode - a.OlderVersion().NbLinesOfCode }

No projects matched

New namespaces
// <Name>New namespaces</Name>
from n in Application.Namespaces where 
 
!n.ParentProject.WasAdded() &&
  
n.WasAdded()
select new { n, n.NbLinesOfCode }

No namespaces matched

Namespaces removed
// <Name>Namespaces removed</Name>
from n in codeBase.OlderVersion().Application.Namespaces where 
 
!n.ParentProject.WasRemoved() &&
  
n.WasRemoved()
select new { n, n.NbLinesOfCode }

No namespaces matched

Namespaces where code was changed
// <Name>Namespaces where code was changed</Name>
from n in Application.Namespaces where n.CodeWasChanged()
select new { n, n.NbLinesOfCode, 
             
oldNbLinesOfCode = n.OlderVersion().NbLinesOfCode ,
             
delta = (int) n.NbLinesOfCode - n.OlderVersion().NbLinesOfCode }

No namespaces matched

New types
// <Name>New types</Name>
from t in Application.Types where 
 
!t.ParentNamespace.WasAdded() &&
  
t.WasAdded()
select new { t, t.NbLinesOfCode }

No types matched

Types removed
// <Name>Types removed</Name>
from t in codeBase.OlderVersion().Application.Types where 
 
!t.ParentNamespace.WasRemoved() &&
  
t.WasRemoved()
select new { t, t.NbLinesOfCode }

No types matched

Types where code was changed
// <Name>Types where code was changed</Name>
// To visualize changes in code, right-click a matched type and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

from t in Application.Types where t.CodeWasChanged() 
//select new { t, t.NbLinesOfCode }
select new { t, t.NbLinesOfCode, 
             
oldNbLinesOfCode = t.OlderVersion().NbLinesOfCode ,
             
delta = (int?) t.NbLinesOfCode - t.OlderVersion().NbLinesOfCode } 
/*from t in Application.Types where t.CodeWasChanged() && t.IsPresentInBothBuild
select new { t, t.NbLinesOfCode, 
             oldNbLinesOfCode = t.OlderVersion().NbLinesOfCode ,
             delta = (int) t.NbLinesOfCode - t.OlderVersion().NbLinesOfCode }*/

No types matched

Heuristic to find types moved from one namespace or project to another
// <Name>Heuristic to find types moved from one namespace or project to another</Name>
let typesRemoved = codeBase.OlderVersion().Types.Where(t => t.WasRemoved())
let typesAdded = Types.Where(t => t.WasAdded())

from tMoved in typesAdded.Join(
   
typesRemoved,
   
t => t.Name,
   
t => t.Name,
   
(tNewer, tOlder) => new { tNewer, 
                             
OlderParentNamespace = tOlder.ParentNamespace,
                             
OlderParentproject = tOlder.ParentProject  } ) 
select tMoved

No types matched

Types directly using one or several types changed
// <Name>Types directly using one or several types changed</Name>
let typesChanged = Application.Types.Where(t => t.CodeWasChanged()).ToHashSet()

from t in JustMyCode.Types.UsingAny(typesChanged) where
  
!t.CodeWasChanged() && 
  
!t.WasAdded()
let typesChangedUsed = t.TypesUsed.Intersect(typesChanged) 
select new { t, typesChangedUsed }

No types matched

Types indirectly using one or several types changed
// <Name>Types indirectly using one or several types changed</Name>
let typesChanged = Application.Types.Where(t => t.CodeWasChanged()).ToHashSet()

// 'depth' represents a code metric defined on types using
// directly or indirectly any type where code was changed.
let depth = JustMyCode.Types.DepthOfIsUsingAny(typesChanged) 

from t in depth.DefinitionDomain where
  
!t.CodeWasChanged() && 
  
!t.WasAdded()

let typesChangedDirectlyUsed = t.TypesUsed.Intersect(typesChanged) 
let depthOfUsingTypesChanged = depth[t]
orderby depthOfUsingTypesChanged 

select new { t, depthOfUsingTypesChanged, typesChangedDirectlyUsed }

No types matched

New methods
// <Name>New methods</Name>
from m in Application.Methods where 
 
!m.ParentType.WasAdded() &&
  
m.WasAdded()
select new { m, m.NbLinesOfCode }

No methods matched

Methods removed
// <Name>Methods removed</Name>
from m in codeBase.OlderVersion().Application.Methods where 
 
!m.ParentType.WasRemoved() &&
  
m.WasRemoved()
select new { m, m.NbLinesOfCode }

No methods matched

Methods where code was changed
// <Name>Methods where code was changed</Name>
// To visualize changes in code, right-click a matched method and select:
//  - Compare older and newer versions of source file
//  - Compare older and newer versions disassembled with Reflector

from m in Application.Methods where m.CodeWasChanged()
select new { m, m.NbLinesOfCode, 
             
oldNbLinesOfCode = m.OlderVersion().NbLinesOfCode ,
             
delta = (int?) m.NbLinesOfCode - m.OlderVersion().NbLinesOfCode }

No methods matched

Methods directly calling one or several methods changed
// <Name>Methods directly calling one or several methods changed</Name>
let methodsChanged = Application.Methods.Where(m => m.CodeWasChanged()).ToHashSet()

from m in JustMyCode.Methods.UsingAny(methodsChanged ) where
  
!m.CodeWasChanged() && 
  
!m.WasAdded()
let methodsChangedCalled = m.MethodsCalled.Intersect(methodsChanged) 
select new { m, methodsChangedCalled }

No methods matched

Methods indirectly calling one or several methods changed
// <Name>Methods indirectly calling one or several methods changed</Name>
let methodsChanged = Application.Methods.Where(m => m.CodeWasChanged()).ToHashSet()

// 'depth' represents a code metric defined on methods using
// directly or indirectly any method where code was changed.
let depth = JustMyCode.Methods.DepthOfIsUsingAny(methodsChanged) 

from m in depth.DefinitionDomain where
  
!m.CodeWasChanged() && 
  
!m.WasAdded()

let methodsChangedDirectlyUsed = m.MethodsCalled.Intersect(methodsChanged) 
let depthOfUsingMethodsChanged = depth[m]
orderby depthOfUsingMethodsChanged 

select new { m, depthOfUsingMethodsChanged, methodsChangedDirectlyUsed }

No methods matched

New fields
// <Name>New fields</Name>
from f in Application.Fields where 
 
!f.ParentType.WasAdded() &&
  
f.WasAdded()
select new { f }

No fields matched

Fields removed
// <Name>Fields removed</Name>
from f in codeBase.OlderVersion().Application.Fields where 
 
!f.ParentType.WasRemoved() &&
  
f.WasRemoved()
select new { f }

No fields matched

Third party types that were not used and that are now used
// <Name>Third party types that were not used and that are now used</Name>
from t in ThirdParty.Types where t.IsUsedRecently()
select new { t, t.Methods, t.Fields } 

No types matched

Third party types that were used and that are not used anymore
// <Name>Third party types that were used and that are not used anymore</Name>
from t in codeBase.OlderVersion().Types where t.IsNotUsedAnymore()
select new { t, t.Methods, t.Fields }  

No types matched

Third party methods that were not used and that are now used
// <Name>Third party methods that were not used and that are now used</Name>
from m in ThirdParty.Methods where 
  
m.IsUsedRecently() &&
 
!m.ParentType.IsUsedRecently()
select m

No methods matched

Third party methods that were used and that are not used anymore
// <Name>Third party methods that were used and that are not used anymore</Name>
from m in codeBase.OlderVersion().Methods where 
  
m.IsNotUsedAnymore() &&
 
!m.ParentType.IsNotUsedAnymore()
select m

No methods matched

Third party fields that were not used and that are now used
// <Name>Third party fields that were not used and that are now used</Name>
from f in ThirdParty.Fields where 
  
f.IsUsedRecently() &&
 
!f.ParentType.IsUsedRecently()
select f

No fields matched

Third party fields that were used and that are not used anymore
// <Name>Third party fields that were used and that are not used anymore</Name>
from f in codeBase.OlderVersion().Fields where 
  
f.IsNotUsedAnymore() &&
 
!f.ParentType.IsNotUsedAnymore()
select f

No fields matched

Test and Code Coverage

C.R.A.P method code metric
• Rule Description:

This rule is executed only if some code coverage data is imported from some code coverage files.

Change Risk Analyzer and Predictor (i.e. CRAP) is a code metric that helps in pinpointing overly complex and untested code. Is has been first defined here: http://www.artima.com/weblogs/viewpost.jsp?thread=215899

The Formula is: CRAP(m) = CC(m)^2 * (1 – cov(m)/100)^3 + CC(m)

• where CC(m) is the cyclomatic complexity of the method m

• and cov(m) is the percentage coverage by tests of the method m

Matched methods cumulates two highly error prone code smells:

• A complex method, difficult to develop and maintain.

• Non 100% covered code, difficult to refactor without introducing any regression bug.

The highest the CRAP score, the more painful to maintain and error prone is the method.

An arbitrary threshold of 30 is fixed for this code rule as suggested by inventors.

Notice that no amount of testing will keep methods with a Cyclomatic Complexity highest than 30, out of CRAP territory.

Notice that this rule doesn't match too short method with less than 10 lines of code.


• How to Fix Violations:

In such situation, it is recommended to both refactor the complex method logic into several smaller and less complex methods (that might belong to some new types especially created), and also write unit-tests to full cover the refactored logic.

You'll find code impossible to cover by unit-tests, like calls to MessageBox.Show(). An infrastructure must be defined to be able to mock such code at test-time.

No methods matched

Complex methods partially covered by tests should be 100% covered
• Rule Description:

This rule is executed only if some code coverage data is imported from some code coverage files.

There are default rules that warn about complex methods to refactor. The present rule warns about complex methods that are already a bit covered by tests but not 100% covered by tests.

Such situation cumulates two highly error prone code smells:

• A complex method, difficult to develop and maintain.

• Non 100% covered code, difficult to refactor without creating any regression bug.

Because the complex method is already covered partially by tests, it might be not so costly to write more tests to full cover it.


• How to Fix Violations:

In such situation, it is recommended to both:

• refactor the complex method logic into several smaller and less complex methods (that might belong to some new types especially created),

• and also write more unit-tests to full cover the refactored logic.

You'll find code impossible to cover by unit-tests, like calls to MessageBox.Show(). An infrastructure must be defined to be able to mock such code at test-time.

No methods matched

Method changed poorly covered
• Rule Description:

This rule is executed only if a baseline for comparison is defined (diff mode). This rule operates only on methods added or refactored since the baseline.

This rule is executed only if some code coverage data is imported from some code coverage files.

It is important to write code mostly covered by tests to achieve maintainable and non-error-prone code.

In real-world, many code bases are poorly covered by tests. However it is not practicable to stop the development for months to refactor and write tests to achieve high code coverage ratio.

Hence it is recommended that each time a method (or a type) gets refactored, the developer takes the time to write associated unit-tests to cover it.

Doing so will help to increase significantly the maintainability of the code base. You'll notice that quickly, refactoring will also be driven by testability, and as a consequence, the overall code structure and design will increase as well.


• How to Fix Violations:

Write unit-tests to cover the code of most methods and classes refactored.

No methods matched

Method added poorly covered
• Rule Description:

This rule is executed only if a baseline for comparison is defined (diff mode). This rule operates only on methods added or refactored since the baseline.

This rule is executed only if some code coverage data is imported from some code coverage files.

It is important to write code mostly covered by tests to achieve maintainable and non-error-prone code.

In real-world, many code bases are poorly covered by tests. However it is not practicable to stop the development for months to refactor and write tests to achieve high code coverage ratio.

Hence it is recommended that each time a method (or a type) gets added, the developer takes the time to write associated unit-tests to cover it.

Doing so will help to increase significantly the maintainability of the code base. You'll notice that quickly, refactoring will also be driven by testability, and as a consequence, the overall code structure and design will increase as well.


• How to Fix Violations:

Write unit-tests to cover the code of most methods and classes added.

No methods matched

Types 95% to 99% covered
• Rule Description:

This rule is executed only if some code coverage data is imported from some code coverage files.

Often covering the few percents of remaining uncovered code of a class, requires as much work as covering the first 90%. For this reason, often teams estimate that 90% coverage is enough. However untestable code usually means poorly written code which usually leads to error prone code. So it might be worth refactoring and making sure to cover the few uncovered lines of code because most tricky bugs might come from this small portion of hard-to-test code.

Not all classes should be 100% covered by tests (like UI code can be hard to test) but you should make sure that most of the logic of your application is defined in some easy-to-test classes, 100% covered by tests.


• How to Fix Violations:

Write more unit-tests dedicated to cover code not covered yet. If you find some hard-to-test code, it is certainly a sign that this code is not well designed and hence, needs refactoring.

No types matched

Namespaces 95% to 99% covered
• Rule Description:

This rule is executed only if some code coverage data is imported from some code coverage files.

Often covering the few percents of remaining uncovered code of one or several classes in a namespace requires as much work as covering the first 90%. For this reason, often teams estimate that 90% coverage is enough. However untestable code usually means poorly written code which usually leads to error prone code. So it might be worth refactoring and making sure to cover the few uncovered lines of code because most tricky bugs might come from this small portion of hard-to-test code.

Not all classes should be 100% covered by tests (like UI code can be hard to test) but you should make sure that most of the logic of your application is defined in some easy-to-test classes, 100% covered by tests.


• How to Fix Violations:

Write more unit-tests dedicated to cover code not covered yet in the namespace. If you find some hard-to-test code, it is certainly a sign that this code is not well designed and hence, needs refactoring.

No namespaces matched

Types not covered at all
• Query Description:

This query is executed only if some code coverage data is imported from some code coverage files.

This code query lists types not covered at all by any test.

Often, when code is not covered at all by test, one can reach decent coverage ratio (like 50% to 90%) just by writing a few tests.

The idea is not to cover code for the sake of it. The idea is that thanks to a small effort of writing a few tests, one can continuously check, that a significant portion of code runs without a problem.

No types matched

Namespaces not covered at all
• Query Description:

This query is executed only if some code coverage data is imported from some code coverage files.

This code query lists namespaces not covered at all by any test.

Often, when code is not covered at all by test, one can reach decent coverage ratio (like 50% to 90%) just by writing a few tests.

The idea is not to cover code for the sake of it. The idea is that thanks to a small effort of writing a few tests, one can continuously check, that a significant portion of code runs without a problem.

No namespaces matched

Test Methods
• Query Description:

We advise to not include test assemblies in code analyzed by NDepend. We estimate that it is acceptable and practical to lower the quality gate of test code, because the important measures for tests are:

• The coverage ratio,

• And the amount of logic results asserted: This includes both assertions in test code, and assertions in code covered by tests, like Code Contract assertions and Debug.Assert(…) assertions.

But if you wish to enforce the quality of test code, you'll need to consider test assemblies in your list of application assemblies analyzed by NDepend.

In such situation, this code query lists tests methods and you can reuse this code in custom rules.

No methods matched

Methods directly called by test Methods
• Query Description:

This query lists all methods directly called by tests methods. Overrides of virtual and abstract methods, called through polymorphism, are not listed. Methods solely invoked through a delegate are not listed. Methods solely invoked through reflection are not listed.

We advise to not include test assemblies in code analyzed by NDepend. We estimate that it is acceptable and practical to lower the quality gate of test code, because the important measures for tests are:

• The coverage ratio,

• And the amount of logic results asserted: This includes both assertions in test code, and assertions in code covered by tests, like Code Contract assertions and Debug.Assert(…) assertions.

But if you wish to run this code query, you'll need to consider test assemblies in your list of application assemblies analyzed by NDepend.

No methods matched

Methods directly and indirectly called by test Methods
• Query Description:

This query lists all methods directly or indirectly called by tests methods. Indirectly called by a test means that a test method calls a method, that calls a method… From this recursion, a code metric named depthOfCalledByTests is inferred, The value 1 means directly called by test, the value 2 means called by a method that is called by a test…

Overrides of virtual and abstract methods, called through polymorphism, are not listed. Methods solely invoked through a delegate are not listed. Methods solely invoked through reflection are not listed.

We advise to not include test assemblies in code analyzed by NDepend. We estimate that it is acceptable and practical to lower the quality gate of test code, because the important measures for tests are:

• The coverage ratio,

• And the amount of logic results asserted: This includes both assertions in test code, and assertions in code covered by tests, like Code Contract assertions and Debug.Assert(…) assertions.

But if you wish to run this code query, you'll need to consider test assemblies in your list of application assemblies analyzed by NDepend.

No methods matched

Dead Code

Potentially dead Types
// <Name>Potentially dead Types</Name>
warnif count > 0

let tt=Types.UsedByAny(Application.Methods).ToHashSet()
// Select types unused
let typesUnused = 
   
from t in JustMyCode.Types where
   
t.NbTypesUsingMe == 0 && !t.IsGlobal  select t



from t in typesUnused  where !tt.Contains(t)
select new { t }
        
        

No types matched

Potentially dead Methods
// <Name>Potentially dead Methods</Name>
warnif count > 0
// Filter procedure for methods that should'nt be considered as dead
let canMethodBeConsideredAsDeadProc = new Func<IMethod, bool>(
    
m => !m.IsPublic &&       // Public methods might be used by client applications of your Projects.
         !m.IsEntryPoint &&            // Main() method is not used by-design.
         !m.IsClassConstructor &&      
         
!m.IsVirtual &&               // Only check for non virtual method that are not seen as used in IL.
         !(m.IsConstructor &&          // Don't take account of protected ctor that might be call by a derived ctors.
           m.IsProtected) &&
         
!m.NameLike (@"^On") &&        //Exclude Events like MFC ones
         !m.IsGeneratedByCompiler
)

// Get methods unused
let methodsUnused = 
   
from m in JustMyCode.Methods where 
   
m.NbMethodsCallingMe == 0 && 
   
canMethodBeConsideredAsDeadProc(m)
   
select m

// Dead methods = methods used only by unused methods (recursive)
let deadMethodsMetric = methodsUnused.FillIterative(
   
methods => // Unique loop, just to let a chance to build the hashset.
              from o in new[] { new object() }
              
// Use a hashet to make Intersect calls much faster!
              let hashset = methods.ToHashSet()
              
from m in codeBase.Application.Methods.UsedByAny(methods).Except(methods)
              
where canMethodBeConsideredAsDeadProc(m) &&
                    
// Select methods called only by methods already considered as dead
                    hashset.Intersect(m.MethodsCallingMe).Count() == m.NbMethodsCallingMe
              
select m)

from m in JustMyCode.Methods.Intersect(deadMethodsMetric.DefinitionDomain)
select new { m, m.MethodsCallingMe, depth = deadMethodsMetric[m] }

3,134 methods matched

methodsMethodsCallingMedepthFull Name
Token()0 method0Token.Token()
Token(constToken&)0 method0Token.Token(constToken&)
operator=(constToken&)0 method0Token.operator=(constToken&)
TokenList(constTokenList&)0 method0TokenList.TokenList(constTokenList&)
operator=(constTokenList&)0 method0TokenList.operator=(constTokenList&)
Tokenizer(constTokenizer&)0 method0Tokenizer.Tokenizer(constTokenizer&)
operator=(constTokenizer&)0 method0Tokenizer.operator=(constTokenizer&)
operator=(constTimer&)0 method0Timer.operator=(constTimer&)
operator=(constCheck&)0 method0Check.operator=(constCheck&)
Check(constCheck&)0 method0Check.Check(constCheck&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0Check64BitPortability.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0Check64BitPortability.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckAssert.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckAssert.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckAutoVariables.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckAutoVariables.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckBool.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckBool.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckBoost.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckBoost.classInfo()
classInfo()0 method0CheckBufferOverrun.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckClass.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckClass.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckCondition.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckCondition.classInfo()
redundantGetAndSetUserIdError(constToken*)0 method0CheckOther.redundantGetAndSetUserIdError(constToken*)
duplicateIfError(constToken*,constToken*)0 method0CheckOther.duplicateIfError(constToken*,constToken*)
alwaysTrueFalseStringCompareError(constToken*,conststd::string& ,conststd::string&)0 method0CheckOther.alwaysTrueFalseStringCompareError(constToken* ,conststd::string&,conststd::string&)
alwaysTrueStringVariableCompareError(constToken*,conststd::string& ,conststd::string&)0 method0CheckOther.alwaysTrueStringVariableCompareError(constToken* ,conststd::string&,conststd::string&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckOther.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckOther.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckString.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckString.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckExceptionSafety.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckExceptionSafety.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckIO.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckIO.classInfo()
ArgumentInfo(constCheckIO::ArgumentInfo&)0 method0CheckIO+ArgumentInfo.ArgumentInfo(constCheckIO::ArgumentInfo&)
operator=(constCheckIO::ArgumentInfo&)0 method0CheckIO+ArgumentInfo.operator=(constCheckIO::ArgumentInfo&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckLeakAutoVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckLeakAutoVar.classInfo()
CheckMemoryLeak()0 method0CheckMemoryLeak.CheckMemoryLeak()
CheckMemoryLeak(constCheckMemoryLeak&)0 method0CheckMemoryLeak.CheckMemoryLeak(constCheckMemoryLeak&)
operator=(constCheckMemoryLeak&)0 method0CheckMemoryLeak.operator=(constCheckMemoryLeak&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakInFunction.getErrorMessages(ErrorLogger*,constSettings* )
classInfo()0 method0CheckMemoryLeakInFunction.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakInClass.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckMemoryLeakInClass.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakStructMember.getErrorMessages(ErrorLogger* ,constSettings*)
classInfo()0 method0CheckMemoryLeakStructMember.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckMemoryLeakNoVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckMemoryLeakNoVar.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckUninitVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckUninitVar.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckNonReentrantFunctions.getErrorMessages(ErrorLogger* ,constSettings*)
classInfo()0 method0CheckNonReentrantFunctions.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckNullPointer.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckNullPointer.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckObsoleteFunctions.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckObsoleteFunctions.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckPostfixOperator.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckPostfixOperator.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckSizeof.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckSizeof.classInfo()
eraseCheckLoop(constToken*)0 method0CheckStl.eraseCheckLoop(constToken*)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckStl.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckStl.classInfo()
operator=(constExecutionPath&)0 method0ExecutionPath.operator=(constExecutionPath&)
is_equal(constExecutionPath*)0 method0EraseCheckLoop.is_equal(constExecutionPath*)
parse(constToken&,std::list<ExecutionPath*>&)0 method0EraseCheckLoop.parse(constToken&,std::list<ExecutionPath*>&)
parseCondition(constToken&,std::list<ExecutionPath*>&)0 method0EraseCheckLoop.parseCondition(constToken&,std::list<ExecutionPath*>&)
isUnsigned(constVariable*)0 method0CheckType.isUnsigned(constVariable*)
isSigned(constVariable*)0 method0CheckType.isSigned(constVariable*)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckType.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckType.classInfo()
copy()0 method0UninitVar.copy()
UninitVar(Check*,constVariable*,constSymbolDatabase*,constLibrary* ,bool)1 method2UninitVar.UninitVar(Check*,constVariable*,constSymbolDatabase* ,constLibrary*,bool)
is_equal(constExecutionPath*)0 method0UninitVar.is_equal(constExecutionPath*)
alloc_pointer(std::list<ExecutionPath*>&,unsignedint)1 method2UninitVar.alloc_pointer(std::list<ExecutionPath*>&,unsignedint)
init_pointer(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.init_pointer(std::list<ExecutionPath*>&,constToken*)
dealloc_pointer(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.dealloc_pointer(std::list<ExecutionPath*>&,constToken*)
pointer_assignment(std::list<ExecutionPath*>&,constToken*,constToken*)1 method2UninitVar.pointer_assignment(std::list<ExecutionPath*>&,constToken* ,constToken*)
init_strncpy(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.init_strncpy(std::list<ExecutionPath*>&,constToken*)
init_memset_nonzero(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.init_memset_nonzero(std::list<ExecutionPath*>&,constToken*)
use_dead_pointer(std::list<ExecutionPath*>&,constToken*)1 method2UninitVar.use_dead_pointer(std::list<ExecutionPath*>&,constToken*)
parserhs(constToken*,std::list<ExecutionPath*>&)1 method2UninitVar.parserhs(constToken*,std::list<ExecutionPath*>&)
parse(constToken&,std::list<ExecutionPath*>&)1 method1UninitVar.parse(constToken&,std::list<ExecutionPath*>&)
parseCondition(constToken&,std::list<ExecutionPath*>&)0 method0UninitVar.parseCondition(constToken&,std::list<ExecutionPath*>&)
parseLoopBody(constToken*,std::list<ExecutionPath*>&)0 method0UninitVar.parseLoopBody(constToken*,std::list<ExecutionPath*>&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckUnusedFunctions.getErrorMessages(ErrorLogger*,constSettings*)
runSimplifiedChecks(constTokenizer*,constSettings*,ErrorLogger*)0 method0CheckUnusedFunctions.runSimplifiedChecks(constTokenizer* ,constSettings*,ErrorLogger*)
classInfo()0 method0CheckUnusedFunctions.classInfo()
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckUnusedVar.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckUnusedVar.classInfo()
operator=(constVariables::ScopeGuard&)0 method0Variables+ScopeGuard.operator=(constVariables::ScopeGuard&)
getErrorMessages(ErrorLogger*,constSettings*)0 method0CheckVaarg.getErrorMessages(ErrorLogger*,constSettings*)
classInfo()0 method0CheckVaarg.classInfo()
reportProgress(conststd::string&,constchar*,conststd::size_t)0 method0CppCheck.reportProgress(conststd::string&,constchar*,conststd::size_t)
operator=(constPreprocessorMacro&)0 method0PreprocessorMacro.operator=(constPreprocessorMacro&)
TemplateSimplifier()0 method0TemplateSimplifier.TemplateSimplifier()

Statistics

Stat   MethodsCallingMe   depth
Sum:03 083
Average:00.98
Minimum:00
Maximum:02
Standard deviation:00.31
Variance:00.097
Potentially dead Fields
// <Name>Potentially dead Fields</Name>
warnif count > 0
from f in JustMyCode.Fields where
   
f.NbMethodsUsingMe == 0 && 
   
!f.IsPublic &&     // Although not recommended, public fields might be used by client applications of your Projects.
   !f.IsEnumValue   
  
   
// If you don't want to link CppDepend.API.dll, you can use your own IsNotDeadCodeAttribute and adapt this rule.
select f

No fields matched

Trend Charts


Lines of Code


Rules Violated


Rules Violations


Max


Average


Third-Party Usage

Projects Dependencies

Assembly Depends on Is referenced by
WindowsAPI v1.0.0.0 - cli v1.0.0.0 ; testrunner v1.0.0.0 ; cppcheck v1.0.0.0 ;
Externals v1.0.0.0 - cli v1.0.0.0 ; testrunner v1.0.0.0 ; cppcheck v1.0.0.0 ;
cppcheck v1.0.0.0WindowsAPI v1.0.0.0 ; Externals v1.0.0.0 ; cli v1.0.0.0 ; testrunner v1.0.0.0 ;
cli v1.0.0.0cppcheck v1.0.0.0 ; WindowsAPI v1.0.0.0 ; Externals v1.0.0.0 ; -
testrunner v1.0.0.0cppcheck v1.0.0.0 ; WindowsAPI v1.0.0.0 ; Externals v1.0.0.0 ; -

Projects Build Order

  1. cppcheck
  2. cli
  3. testrunner

Projects Build Order

  1. cppcheck
  2. cli
  3. testrunner

Analysis Log : Information and Warnings

Here are Logs emitted during CppDepend analysis.
The Warnings can reveal potential flaws concerning the health of the build process.
A particular warn can be disabled through the CppDepend interactive UI, panel Error List, tick the checkbox Disabled corresponding to the warn to disable.


Kind Message
InfoBegin full analysis with CppDepend v6.0.0.8890
InfoNo Baseline for Comparison loaded.
InfoThe parser used is Clang
Info2 Cores are used, you can change this value from the menu Tools->Options->Parser Configuration
InfoCppCheck is enabled.You can disable it from 'Project Properties=>Plugins Tab'
InfoVera++ is not enabled.You can enable it from 'Project Properties=>Plugins Tab' if you are interested to have style diagnostics
WarningProject:cli=>expected unqualified-id at C:\Users\MacBook Pro\Downloads\cppcheck-1.69\cppcheck-1.69\cli\version.rc:4:1
WarningThe project cli contains 1 Clang errors, to see them you can activate the Clang parsing errors tab.
WarningProject:testrunner=>'testsuite.h' file not found at <command line>:11:10
WarningProject:testrunner=>'testsuite.h' file not found at <command line>:11:10
WarningProject:testrunner=>'testsuite.h' file not found at <command line>:11:10
WarningProject:testrunner=>'testsuite.h' file not found at <command line>:11:10
WarningProject:testrunner=>'testsuite.h' file not found at <command line>:11:10
WarningThe project testrunner contains 5 Clang errors, to see them you can activate the Clang parsing errors tab.
InfoNo dependency cycle detected in Projects referencement graph.
InfoAnalyse dependencies of your application.
InfoLog trend metrics values.
InfoExecute queries and rules
Warning3 critical rules are violated. - Types too big - critical - Methods too complex - critical - Methods with too many parameters - critical
InfoCppDepend analysis done. Duration: 03:58
InfoBuilding the report (standard).