microsoft / CCF
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
cmake
in
tla
patch
texi
ini
cfg
clang-format
dockerignore
gitattributes
TXT
hbs
clang-tidy
prettierignore
  • 34 extensions are included in analyses: hpp, h, cpp, py, rst, yml, js, c, json, md, sh, cc, ts, txt, cmake, in, svg, jinja, html, gitignore, tla, patch, texi, ini, cfg, clang-format, css, dockerignore, gitattributes, TXT, cjs, hbs, clang-tidy, prettierignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (50 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (1030 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (0 files).
    • exclude files with path like ".*/docs?/_?(build|themes?|templates?|static)/.*" (Sphinx) (6 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) (13 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.

main60125 LOC (51%) 433 files
test38677 LOC (33%) 176 files
generated0 LOC (0%) 0 files
build and deployment848 LOC (<1%) 16 files
other16145 LOC (13%) 146 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tla
cmake
cfg
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 433 files match defined criteria (60,125 lines of code, 100.0% vs. main code):
    • 301 *.h files (44,141 lines of code)
    • 56 *.cpp files (9,918 lines of code)
    • 17 *.py files (1,822 lines of code)
    • 4 *.tla files (1,562 lines of code)
    • 12 *.cmake files (1,309 lines of code)
    • 10 *.ts files (769 lines of code)
    • 23 *.yml files (470 lines of code)
    • 2 *.cfg files (61 lines of code)
    • 5 *.in files (32 lines of code)
    • 1 *.js files (30 lines of code)
    • 1 *.c files (10 lines of code)
    • 1 *.html files (1 lines of code)
  • " *.h" is biggest, containing 73.42% of code.
  • " *.html" is smallest, containing 0% of code.


*.h44141 LOC (73%) 301 files
*.cpp9918 LOC (16%) 56 files
*.py1822 LOC (3%) 17 files
*.tla1562 LOC (2%) 4 files
*.cmake1309 LOC (2%) 12 files
*.ts769 LOC (1%) 10 files
*.yml470 LOC (<1%) 23 files
*.cfg61 LOC (<1%) 2 files
*.in32 LOC (<1%) 5 files
*.js30 LOC (<1%) 1 files
*.c10 LOC (<1%) 1 files
*.html1 LOC (<1%) 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 ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*_test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 176 files match defined criteria (38,677 lines of code, 64.3% vs. main code):
    • 56 *.cpp files (19,720 lines of code)
    • 71 *.py files (13,950 lines of code)
    • 10 *.h files (2,476 lines of code)
    • 18 *.js files (1,435 lines of code)
    • 12 *.ts files (785 lines of code)
    • 8 *.sh files (222 lines of code)
    • 1 *.jinja files (89 lines of code)
  • " *.cpp" is biggest, containing 50.99% of code.
  • " *.jinja" is smallest, containing 0.23% of code.


*.cpp19720 LOC (50%) 56 files
*.py13950 LOC (36%) 71 files
*.h2476 LOC (6%) 10 files
*.js1435 LOC (3%) 18 files
*.ts785 LOC (2%) 12 files
*.sh222 LOC (<1%) 8 files
*.jinja89 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[.]json".
  • 16 files match defined criteria (848 lines of code, 1.4% vs. main code). All matches are in *.sh files.


*.sh848 LOC (100%) 16 files
Other Code
patch
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]prettierignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]texi".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[Ss]amples/.*".
  • 146 files match defined criteria (16,145 lines of code, 26.9% vs. main code):
    • 29 *.json files (5,984 lines of code)
    • 73 *.rst files (4,315 lines of code)
    • 11 *.js files (1,575 lines of code)
    • 2 *.cpp files (1,512 lines of code)
    • 17 *.md files (1,071 lines of code)
    • 4 *.svg files (771 lines of code)
    • 1 *.patch files (434 lines of code)
    • 1 *.py files (183 lines of code)
    • 1 *.h files (121 lines of code)
    • 5 *.jinja files (113 lines of code)
    • 2 *.ini files (66 lines of code)
  • " *.json" is biggest, containing 37.06% of code.
  • " *.ini" is smallest, containing 0.41% of code.


*.json5984 LOC (37%) 29 files
*.rst4315 LOC (26%) 73 files
*.js1575 LOC (9%) 11 files
*.cpp1512 LOC (9%) 2 files
*.md1071 LOC (6%) 17 files
*.svg771 LOC (4%) 4 files
*.patch434 LOC (2%) 1 files
*.py183 LOC (1%) 1 files
*.h121 LOC (<1%) 1 files
*.jinja113 LOC (<1%) 5 files
*.ini66 LOC (<1%) 2 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
  • *.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
  • *.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
  • *.tla 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
  • *.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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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
  • *.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
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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-01-31 01:07