microsoft / automatic-graph-layout
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
csproj
resx
geom
xaml
nuspec
cmd
glade
gitattributes
targets
editorconfig
lex
props
y
  • 28 extensions are included in analyses: cs, txt, csproj, resx, ts, geom, js, xaml, css, json, html, ps1, nuspec, gitignore, cmd, xml, md, yml, glade, py, gitattributes, targets, bat, editorconfig, lex, svg, props, y
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (9 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (6 files).
    • exclude files with path like ".*/[Pp]ackages\/.+\.\d+\/.*" (NuGet) (2 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (42 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) (329 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.

main107102 LOC (60%) 687 files
test53195 LOC (29%) 156 files
generated2275 LOC (1%) 39 files
build and deployment3579 LOC (2%) 26 files
other12264 LOC (6%) 212 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
y
lex
props
cmd
xaml
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 687 files match defined criteria (107,102 lines of code, 100.0% vs. main code):
    • 662 *.cs files (94,494 lines of code)
    • 6 *.js files (8,676 lines of code)
    • 7 *.ts files (2,776 lines of code)
    • 2 *.css files (703 lines of code)
    • 1 *.y files (286 lines of code)
    • 1 *.lex files (91 lines of code)
    • 3 *.ps1 files (38 lines of code)
    • 1 *.py files (17 lines of code)
    • 1 *.props files (7 lines of code)
    • 1 *.cmd files (6 lines of code)
    • 1 *.xaml files (5 lines of code)
    • 1 *.targets files (3 lines of code)
  • " *.cs" is biggest, containing 88.23% of code.
  • " *.targets" is smallest, containing 0% of code.


*.cs94494 LOC (88%) 662 files
*.js8676 LOC (8%) 6 files
*.ts2776 LOC (2%) 7 files
*.css703 LOC (<1%) 2 files
*.y286 LOC (<1%) 1 files
*.lex91 LOC (<1%) 1 files
*.ps138 LOC (<1%) 3 files
*.py17 LOC (<1%) 1 files
*.props7 LOC (<1%) 1 files
*.cmd6 LOC (<1%) 1 files
*.xaml5 LOC (<1%) 1 files
*.targets3 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
geom
csproj
xaml
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 156 files match defined criteria (53,195 lines of code, 49.7% vs. main code):
    • 120 *.cs files (42,109 lines of code)
    • 15 *.geom files (8,181 lines of code)
    • 11 *.csproj files (2,306 lines of code)
    • 8 *.xaml files (366 lines of code)
    • 2 *.cmd files (233 lines of code)
  • " *.cs" is biggest, containing 79.16% of code.
  • " *.cmd" is smallest, containing 0.44% of code.


*.cs42109 LOC (79%) 120 files
*.geom8181 LOC (15%) 15 files
*.csproj2306 LOC (4%) 11 files
*.xaml366 LOC (<1%) 8 files
*.cmd233 LOC (<1%) 2 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 "[/][/][ ]*".
    • files with paths like ".*[.]designer[.](cs|vb)".
  • 39 files match defined criteria (2,275 lines of code, 2.1% vs. main code). All matches are in *.cs files.


*.cs2275 LOC (100%) 39 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
csproj
nuspec
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 ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]bat".
  • 26 files match defined criteria (3,579 lines of code, 3.3% vs. main code):
    • 21 *.csproj files (3,457 lines of code)
    • 4 *.nuspec files (118 lines of code)
    • 1 *.bat files (4 lines of code)
  • " *.csproj" is biggest, containing 96.59% of code.
  • " *.bat" is smallest, containing 0.11% of code.


*.csproj3457 LOC (96%) 21 files
*.nuspec118 LOC (3%) 4 files
*.bat4 LOC (<1%) 1 files
Other Code
csproj
xaml
glade
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 ".*/[.]gitignore".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 212 files match defined criteria (12,264 lines of code, 11.5% vs. main code):
    • 137 *.cs files (8,969 lines of code)
    • 28 *.csproj files (1,906 lines of code)
    • 15 *.ts files (336 lines of code)
    • 5 *.json files (322 lines of code)
    • 1 *.svg files (231 lines of code)
    • 7 *.html files (168 lines of code)
    • 2 *.md files (146 lines of code)
    • 8 *.css files (113 lines of code)
    • 6 *.xaml files (47 lines of code)
    • 1 *.glade files (16 lines of code)
    • 2 *.xml files (10 lines of code)
  • " *.cs" is biggest, containing 73.13% of code.
  • " *.xml" is smallest, containing 0.08% of code.


*.cs8969 LOC (73%) 137 files
*.csproj1906 LOC (15%) 28 files
*.ts336 LOC (2%) 15 files
*.json322 LOC (2%) 5 files
*.svg231 LOC (1%) 1 files
*.html168 LOC (1%) 7 files
*.md146 LOC (1%) 2 files
*.css113 LOC (<1%) 8 files
*.xaml47 LOC (<1%) 6 files
*.glade16 LOC (<1%) 1 files
*.xml10 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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)
  • *.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
  • *.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
  • *.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
  • *.y 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
  • *.lex 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.xaml 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
  • *.targets 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 09:32