microsoft / Detours
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
mak
filters
Txt
txt
vcxproj
editorconfig
  • 16 extensions are included in analyses: cpp, h, TXT, md, asm, yml, hpp, mak, gitignore, filters, cs, Txt, txt, vcxproj, json, editorconfig
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 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).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main11464 LOC (14%) 15 files
test14271 LOC (17%) 10 files
generated0 LOC (0%) 0 files
build and deployment125 LOC (<1%) 1 files
other55330 LOC (68%) 96 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
filters
vcxproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 15 files match defined criteria (11,464 lines of code, 100.0% vs. main code):
    • 11 *.cpp files (9,325 lines of code)
    • 2 *.h files (930 lines of code)
    • 1 *.filters files (605 lines of code)
    • 1 *.vcxproj files (604 lines of code)
  • " *.cpp" is biggest, containing 81.34% of code.
  • " *.vcxproj" is smallest, containing 5.27% of code.


*.cpp9325 LOC (81%) 11 files
*.h930 LOC (8%) 2 files
*.filters605 LOC (5%) 1 files
*.vcxproj604 LOC (5%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 10 files match defined criteria (14,271 lines of code, 124.5% vs. main code):
    • 1 *.hpp files (13,605 lines of code)
    • 6 *.cpp files (613 lines of code)
    • 3 *.h files (53 lines of code)
  • " *.hpp" is biggest, containing 95.33% of code.
  • " *.h" is smallest, containing 0.37% of code.


*.hpp13605 LOC (95%) 1 files
*.cpp613 LOC (4%) 6 files
*.h53 LOC (<1%) 3 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mak
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]mak".
  • 1 file matches defined criteria (125 lines of code, 1.1% vs. main code). All matches are in *.mak files.


*.mak125 LOC (100%) 1 files
Other Code
txt
mak
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
  • 96 files match defined criteria (55,330 lines of code, 482.6% vs. main code):
    • 72 *.cpp files (52,381 lines of code)
    • 5 *.asm files (1,814 lines of code)
    • 7 *.txt files (734 lines of code)
    • 6 *.h files (155 lines of code)
    • 3 *.md files (141 lines of code)
    • 1 *.mak files (62 lines of code)
    • 1 *.cs files (36 lines of code)
    • 1 *.hpp files (7 lines of code)
  • " *.cpp" is biggest, containing 94.67% of code.
  • " *.hpp" is smallest, containing 0.01% of code.


*.cpp52381 LOC (94%) 72 files
*.asm1814 LOC (3%) 5 files
*.txt734 LOC (1%) 7 files
*.h155 LOC (<1%) 6 files
*.md141 LOC (<1%) 3 files
*.mak62 LOC (<1%) 1 files
*.cs36 LOC (<1%) 1 files
*.hpp7 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.filters 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
  • *.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


2022-01-30 14:03