microsoft / CNTK
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
filters
csproj
i
cmake
ini
cmd
xaml
TXT
wl
patch
props
proto
asax
dockerignore
clang-format
gitmodules
gitattributes
arpa
inl
awk
vssettings
bib
  • 47 extensions are included in analyses: txt, py, h, cpp, yml, md, cs, vcxproj, filters, ipynb, sh, ps1, csproj, bat, rst, json, cu, i, xml, pl, cc, cmake, ini, cmd, xaml, TXT, html, cuh, m, wl, patch, java, props, hpp, psm1, proto, asax, dockerignore, gitignore, clang-format, gitmodules, gitattributes, arpa, inl, awk, vssettings, bib
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 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) (415 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.

main223732 LOC (61%) 828 files
test52639 LOC (14%) 435 files
generated0 LOC (0%) 0 files
build and deployment1555 LOC (<1%) 18 files
other86277 LOC (23%) 508 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
i
filters
proto
cmake
props
vssettings
cmd
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 828 files match defined criteria (223,732 lines of code, 100.0% vs. main code):
    • 239 *.cpp files (89,098 lines of code)
    • 332 *.h files (77,849 lines of code)
    • 103 *.py files (20,531 lines of code)
    • 10 *.cu files (9,929 lines of code)
    • 3 *.cuh files (6,745 lines of code)
    • 31 *.vcxproj files (4,642 lines of code)
    • 9 *.i files (3,569 lines of code)
    • 28 *.filters files (3,133 lines of code)
    • 17 *.ps1 files (3,003 lines of code)
    • 20 *.cs files (1,708 lines of code)
    • 6 *.cc files (1,276 lines of code)
    • 2 *.proto files (499 lines of code)
    • 2 *.hpp files (330 lines of code)
    • 8 *.yml files (312 lines of code)
    • 6 *.cmake files (293 lines of code)
    • 2 *.props files (231 lines of code)
    • 2 *.psm1 files (159 lines of code)
    • 1 *.vssettings files (143 lines of code)
    • 1 *.java files (137 lines of code)
    • 2 *.cmd files (89 lines of code)
    • 4 *.txt files (56 lines of code)
  • " *.cpp" is biggest, containing 39.82% of code.
  • " *.txt" is smallest, containing 0.03% of code.


*.cpp89098 LOC (39%) 239 files
*.h77849 LOC (34%) 332 files
*.py20531 LOC (9%) 103 files
*.cu9929 LOC (4%) 10 files
*.cuh6745 LOC (3%) 3 files
*.vcxproj4642 LOC (2%) 31 files
*.i3569 LOC (1%) 9 files
*.filters3133 LOC (1%) 28 files
*.ps13003 LOC (1%) 17 files
*.cs1708 LOC (<1%) 20 files
*.cc1276 LOC (<1%) 6 files
*.proto499 LOC (<1%) 2 files
*.hpp330 LOC (<1%) 2 files
*.yml312 LOC (<1%) 8 files
*.cmake293 LOC (<1%) 6 files
*.props231 LOC (<1%) 2 files
*.psm1159 LOC (<1%) 2 files
*.vssettings143 LOC (<1%) 1 files
*.java137 LOC (<1%) 1 files
*.cmd89 LOC (<1%) 2 files
*.txt56 LOC (<1%) 4 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
vcxproj
filters
csproj
xaml
cmd
awk
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 ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/UnitTests?/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 435 files match defined criteria (52,639 lines of code, 23.5% vs. main code):
    • 74 *.cpp files (22,558 lines of code)
    • 153 *.py files (19,397 lines of code)
    • 34 *.h files (2,646 lines of code)
    • 108 *.yml files (2,327 lines of code)
    • 15 *.vcxproj files (2,122 lines of code)
    • 16 *.cs files (1,342 lines of code)
    • 11 *.filters files (1,105 lines of code)
    • 8 *.csproj files (609 lines of code)
    • 4 *.sh files (129 lines of code)
    • 1 *.m files (97 lines of code)
    • 1 *.java files (82 lines of code)
    • 2 *.ps1 files (50 lines of code)
    • 1 *.html files (49 lines of code)
    • 3 *.xaml files (40 lines of code)
    • 2 *.cmd files (40 lines of code)
    • 1 *.bat files (26 lines of code)
    • 1 *.awk files (20 lines of code)
  • " *.cpp" is biggest, containing 42.85% of code.
  • " *.awk" is smallest, containing 0.04% of code.


*.cpp22558 LOC (42%) 74 files
*.py19397 LOC (36%) 153 files
*.h2646 LOC (5%) 34 files
*.yml2327 LOC (4%) 108 files
*.vcxproj2122 LOC (4%) 15 files
*.cs1342 LOC (2%) 16 files
*.filters1105 LOC (2%) 11 files
*.csproj609 LOC (1%) 8 files
*.sh129 LOC (<1%) 4 files
*.m97 LOC (<1%) 1 files
*.java82 LOC (<1%) 1 files
*.ps150 LOC (<1%) 2 files
*.html49 LOC (<1%) 1 files
*.xaml40 LOC (<1%) 3 files
*.cmd40 LOC (<1%) 2 files
*.bat26 LOC (<1%) 1 files
*.awk20 LOC (<1%) 1 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
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 ".*/[.]gitmodules".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/pom[.]xml".
  • 18 files match defined criteria (1,555 lines of code, 0.7% vs. main code):
    • 10 *.bat files (1,077 lines of code)
    • 7 *.sh files (333 lines of code)
    • 1 *.csproj files (145 lines of code)
  • " *.bat" is biggest, containing 69.26% of code.
  • " *.csproj" is smallest, containing 9.32% of code.


*.bat1077 LOC (69%) 10 files
*.sh333 LOC (21%) 7 files
*.csproj145 LOC (9%) 1 files
Other Code
arpa
bib
vcxproj
wl
csproj
filters
patch
inl
xaml
cmd
ini
asax
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 508 files match defined criteria (86,277 lines of code, 38.6% vs. main code):
    • 7 *.xml files (37,769 lines of code)
    • 197 *.py files (16,656 lines of code)
    • 10 *.ipynb files (7,971 lines of code)
    • 1 *.arpa files (3,788 lines of code)
    • 93 *.md files (3,415 lines of code)
    • 34 *.cs files (2,961 lines of code)
    • 1 *.bib files (2,448 lines of code)
    • 11 *.rst files (1,729 lines of code)
    • 20 *.sh files (1,560 lines of code)
    • 51 *.yml files (1,139 lines of code)
    • 11 *.cpp files (1,116 lines of code)
    • 9 *.vcxproj files (1,103 lines of code)
    • 3 *.wl files (1,098 lines of code)
    • 8 *.csproj files (863 lines of code)
    • 10 *.json files (790 lines of code)
    • 7 *.h files (446 lines of code)
    • 7 *.pl files (443 lines of code)
    • 3 *.html files (279 lines of code)
    • 9 *.filters files (239 lines of code)
    • 2 *.m files (232 lines of code)
    • 2 *.patch files (121 lines of code)
    • 1 *.inl files (39 lines of code)
    • 2 *.xaml files (33 lines of code)
    • 1 *.cmd files (20 lines of code)
    • 6 *.ini files (17 lines of code)
    • 2 *.asax files (2 lines of code)
  • " *.xml" is biggest, containing 43.78% of code.
  • " *.asax" is smallest, containing 0% of code.


*.xml37769 LOC (43%) 7 files
*.py16656 LOC (19%) 197 files
*.ipynb7971 LOC (9%) 10 files
*.arpa3788 LOC (4%) 1 files
*.md3415 LOC (3%) 93 files
*.cs2961 LOC (3%) 34 files
*.bib2448 LOC (2%) 1 files
*.rst1729 LOC (2%) 11 files
*.sh1560 LOC (1%) 20 files
*.yml1139 LOC (1%) 51 files
*.cpp1116 LOC (1%) 11 files
*.vcxproj1103 LOC (1%) 9 files
*.wl1098 LOC (1%) 3 files
*.csproj863 LOC (1%) 8 files
*.json790 LOC (<1%) 10 files
*.h446 LOC (<1%) 7 files
*.pl443 LOC (<1%) 7 files
*.html279 LOC (<1%) 3 files
*.filters239 LOC (<1%) 9 files
*.m232 LOC (<1%) 2 files
*.patch121 LOC (<1%) 2 files
*.inl39 LOC (<1%) 1 files
*.xaml33 LOC (<1%) 2 files
*.cmd20 LOC (<1%) 1 files
*.ini17 LOC (<1%) 6 files
*.asax2 LOC (<1%) 2 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
  • *.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
  • *.cu 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
  • *.cuh 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
  • *.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
  • *.i 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
  • *.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
  • *.ps1 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
  • *.cs files are analyzed with CSharpAnalyzer:
    • 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 (based on namespace heuristics)
  • *.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
  • *.proto 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.psm1 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
  • *.vssettings 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
  • *.java files are analyzed with JavaAnalyzer:
    • 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 (based on package names)
  • *.cmd 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
  • *.txt 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


2022-01-30 11:32