microsoft / Windows-Machine-Learning
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
xaml
csproj
vcxproj
filters
txt
props
gitattributes
editorconfig
clang-format
gitmodules
cmd
jsproj
hlsl
resx
pb
  • 32 extensions are included in analyses: cs, h, xaml, cpp, md, csproj, json, ts, vcxproj, tsx, filters, txt, css, xml, js, py, gitignore, props, html, ps1, rs, gitattributes, yml, editorconfig, clang-format, gitmodules, cmd, jsproj, toml, hlsl, resx, pb
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (12 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (1 file).
    • exclude files with path like ".*/deps/.*" (Dependencies) (1 file).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (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).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (12 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.

main17257 LOC (31%) 101 files
test66 LOC (<1%) 2 files
generated33 LOC (<1%) 1 files
build and deployment171 LOC (<1%) 1 files
other37150 LOC (67%) 327 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vcxproj
filters
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 101 files match defined criteria (17,257 lines of code, 100.0% vs. main code):
    • 15 *.cpp files (4,783 lines of code)
    • 21 *.h files (4,731 lines of code)
    • 5 *.vcxproj files (2,188 lines of code)
    • 15 *.ts files (2,074 lines of code)
    • 14 *.tsx files (1,810 lines of code)
    • 5 *.cs files (507 lines of code)
    • 11 *.css files (271 lines of code)
    • 5 *.js files (261 lines of code)
    • 2 *.yml files (221 lines of code)
    • 4 *.filters files (200 lines of code)
    • 1 *.py files (132 lines of code)
    • 1 *.cmd files (41 lines of code)
    • 2 *.html files (38 lines of code)
  • " *.cpp" is biggest, containing 27.72% of code.
  • " *.html" is smallest, containing 0.22% of code.


*.cpp4783 LOC (27%) 15 files
*.h4731 LOC (27%) 21 files
*.vcxproj2188 LOC (12%) 5 files
*.ts2074 LOC (12%) 15 files
*.tsx1810 LOC (10%) 14 files
*.cs507 LOC (2%) 5 files
*.css271 LOC (1%) 11 files
*.js261 LOC (1%) 5 files
*.yml221 LOC (1%) 2 files
*.filters200 LOC (1%) 4 files
*.py132 LOC (<1%) 1 files
*.cmd41 LOC (<1%) 1 files
*.html38 LOC (<1%) 2 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]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 2 files match defined criteria (66 lines of code, 0.4% vs. main code):
    • 1 *.js files (58 lines of code)
    • 1 *.ts files (8 lines of code)
  • " *.js" is biggest, containing 87.88% of code.
  • " *.ts" is smallest, containing 12.12% of code.


*.js58 LOC (87%) 1 files
*.ts8 LOC (12%) 1 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 1 file matches defined criteria (33 lines of code, 0.2% vs. main code). All matches are in *.cs files.


*.cs33 LOC (100%) 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 ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*/package[.]json".
  • 1 file matches defined criteria (171 lines of code, 1.0% vs. main code). All matches are in *.csproj files.


*.csproj171 LOC (100%) 1 files
Other Code
xaml
csproj
vcxproj
filters
jsproj
props
hlsl
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 327 files match defined criteria (37,150 lines of code, 215.3% vs. main code):
    • 36 *.h files (10,286 lines of code)
    • 98 *.cs files (9,863 lines of code)
    • 15 *.json files (4,280 lines of code)
    • 46 *.xaml files (3,250 lines of code)
    • 16 *.csproj files (2,404 lines of code)
    • 11 *.vcxproj files (2,275 lines of code)
    • 30 *.cpp files (2,125 lines of code)
    • 38 *.md files (1,386 lines of code)
    • 10 *.filters files (466 lines of code)
    • 4 *.py files (347 lines of code)
    • 2 *.rs files (115 lines of code)
    • 1 *.js files (105 lines of code)
    • 1 *.jsproj files (87 lines of code)
    • 11 *.xml files (55 lines of code)
    • 4 *.props files (35 lines of code)
    • 1 *.html files (23 lines of code)
    • 1 *.toml files (17 lines of code)
    • 1 *.hlsl files (16 lines of code)
    • 1 *.css files (15 lines of code)
  • " *.h" is biggest, containing 27.69% of code.
  • " *.css" is smallest, containing 0.04% of code.


*.h10286 LOC (27%) 36 files
*.cs9863 LOC (26%) 98 files
*.json4280 LOC (11%) 15 files
*.xaml3250 LOC (8%) 46 files
*.csproj2404 LOC (6%) 16 files
*.vcxproj2275 LOC (6%) 11 files
*.cpp2125 LOC (5%) 30 files
*.md1386 LOC (3%) 38 files
*.filters466 LOC (1%) 10 files
*.py347 LOC (<1%) 4 files
*.rs115 LOC (<1%) 2 files
*.js105 LOC (<1%) 1 files
*.jsproj87 LOC (<1%) 1 files
*.xml55 LOC (<1%) 11 files
*.props35 LOC (<1%) 4 files
*.html23 LOC (<1%) 1 files
*.toml17 LOC (<1%) 1 files
*.hlsl16 LOC (<1%) 1 files
*.css15 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
  • *.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
  • *.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
  • *.tsx 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
  • *.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)
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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-30 15:48