korosuke613 / travis-gtest-cmake-example
Source Code Overview

Analysis scope, overview of main, test, generated, deployment, build, and other code.

Source Code Analysis Scope
Files includes and excluded from analyses
txt
vcxproj
plist
in
m4
props
cmake
  • 17 extensions are included in analyses: cc, md, h, py, txt, vcxproj, sh, plist, yml, cpp, in, gitignore, m4, props, cmake, json, hpp
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/docs/.*" (Documentation) (51 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*[.]m4" (stuff autogenerated by autoconf - still C deps) (2 files).
    • exclude files with path like ".*/git[-]history[.]txt" (Git history) (1 file).
    • exclude files with path like ".*/git[-][a-zA-Z0-9_]+[.]txt" (Git data exports for sokrates analyses) (0 files).
Overview of Analyzed Files
Basic stats on analyzed files
Intro
For analysis purposes we separate files in scope into several categories: main, test, generated, deployment and build, and other.

  • The main category contains all manually created source code files that are being used in the production.
  • Files in the main category are used as input for other analyses: logical decomposition, concerns, duplication, file size, unit size, and conditional complexity.
  • Test source code files are used only for testing of the product. These files are normally not deployed to production.
  • Build and deployment source code files are used to configure or support build and deployment process.
  • Generated source code files are automatically generated files that have not been manually changed after generation.
  • While a source code folder may contain a number of files, we are primarily interested in the source code files that are being written and maintained by developers.
  • Files containing binaries, documentation, or third-party libraries, for instance, are excluded from analysis. The exception are third-party libraries that have been changed by developers.

main37252 LOC (53%) 88 files
test28993 LOC (41%) 92 files
generated0 LOC (0%) 0 files
build and deployment38 LOC (<1%) 2 files
other3010 LOC (4%) 36 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
in
vcxproj
cmake
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 88 files match defined criteria (37,252 lines of code, 100.0% vs. main code):
    • 40 *.h files (24,243 lines of code)
    • 17 *.cc files (6,719 lines of code)
    • 19 *.py files (5,086 lines of code)
    • 2 *.in files (459 lines of code)
    • 4 *.vcxproj files (344 lines of code)
    • 1 *.cmake files (236 lines of code)
    • 1 *.yml files (59 lines of code)
    • 1 *.cpp files (39 lines of code)
    • 2 *.props files (38 lines of code)
    • 1 *.hpp files (29 lines of code)
  • " *.h" is biggest, containing 65.08% of code.
  • " *.hpp" is smallest, containing 0.08% of code.


*.h24243 LOC (65%) 40 files
*.cc6719 LOC (18%) 17 files
*.py5086 LOC (13%) 19 files
*.in459 LOC (1%) 2 files
*.vcxproj344 LOC (<1%) 4 files
*.cmake236 LOC (<1%) 1 files
*.yml59 LOC (<1%) 1 files
*.cpp39 LOC (<1%) 1 files
*.props38 LOC (<1%) 2 files
*.hpp29 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*[-]test[-].*".
  • 92 files match defined criteria (28,993 lines of code, 77.8% vs. main code):
    • 64 *.cc files (26,076 lines of code)
    • 19 *.py files (1,997 lines of code)
    • 6 *.h files (667 lines of code)
    • 2 *.vcxproj files (204 lines of code)
    • 1 *.cpp files (49 lines of code)
  • " *.cc" is biggest, containing 89.94% of code.
  • " *.cpp" is smallest, containing 0.17% of code.


*.cc26076 LOC (89%) 64 files
*.py1997 LOC (6%) 19 files
*.h667 LOC (2%) 6 files
*.vcxproj204 LOC (<1%) 2 files
*.cpp49 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 2 files match defined criteria (38 lines of code, 0.1% vs. main code). All matches are in *.sh files.


*.sh38 LOC (100%) 2 files
Other Code
txt
plist
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]plist".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*/[.]gitignore".
  • 36 files match defined criteria (3,010 lines of code, 8.1% vs. main code):
    • 7 *.txt files (1,461 lines of code)
    • 15 *.cc files (625 lines of code)
    • 4 *.md files (578 lines of code)
    • 6 *.h files (194 lines of code)
    • 1 *.json files (72 lines of code)
    • 2 *.plist files (58 lines of code)
    • 1 *.sh files (22 lines of code)
  • " *.txt" is biggest, containing 48.54% of code.
  • " *.sh" is smallest, containing 0.73% of code.


*.txt1461 LOC (48%) 7 files
*.cc625 LOC (20%) 15 files
*.md578 LOC (19%) 4 files
*.h194 LOC (6%) 6 files
*.json72 LOC (2%) 1 files
*.plist58 LOC (1%) 2 files
*.sh22 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.h files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis
  • *.cc files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis
  • *.py files are analyzed with PythonAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Basic heuristic dependency analysis
  • *.in files are analyzed with RustAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • No dependency analysis
  • *.vcxproj files are analyzed with XmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.cmake files are analyzed with DefaultLanguageAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Basic code cleaning (empty lines removed for LOC calculations and duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.yml files are analyzed with YamlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.cpp files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis
  • *.props files are analyzed with XmlAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • No unit size analysis
    • No conditional complexity analysis
    • No dependency analysis
  • *.hpp files are analyzed with CppAnalyzer:
    • All basic standard analyses supported (source code overview, duplication, file size, concerns, findings, metrics, controls)
    • Advanced code cleaning (empty lines and comments removed for LOC calculations, additional cleaning for duplication calculations)
    • Unit size analysis
    • Conditional complexity analysis
    • Advanced heuristic dependency analysis


2022-05-14 00:23