microsoft / AMBROSIA
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
csproj
xaml
txt
plist
resx
storyboard
dockerignore
cmd
gitattributes
nuspec
  • 24 extensions are included in analyses: cs, ts, csproj, md, json, sh, xml, xaml, ps1, gitignore, txt, plist, yml, c, resx, bat, h, storyboard, js, dockerignore, cmd, gitattributes, nuspec, svg
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (23 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (11 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (4 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) (8 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.

main44341 LOC (66%) 270 files
test1276 LOC (1%) 7 files
generated4296 LOC (6%) 15 files
build and deployment5739 LOC (8%) 65 files
other10545 LOC (15%) 205 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xaml
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 270 files match defined criteria (44,341 lines of code, 100.0% vs. main code):
    • 154 *.cs files (27,531 lines of code)
    • 76 *.ts files (14,123 lines of code)
    • 4 *.c files (1,315 lines of code)
    • 9 *.ps1 files (660 lines of code)
    • 18 *.xaml files (382 lines of code)
    • 3 *.h files (136 lines of code)
    • 2 *.js files (114 lines of code)
    • 2 *.yml files (64 lines of code)
    • 2 *.cmd files (16 lines of code)
  • " *.cs" is biggest, containing 62.09% of code.
  • " *.cmd" is smallest, containing 0.04% of code.


*.cs27531 LOC (62%) 154 files
*.ts14123 LOC (31%) 76 files
*.c1315 LOC (2%) 4 files
*.ps1660 LOC (1%) 9 files
*.xaml382 LOC (<1%) 18 files
*.h136 LOC (<1%) 3 files
*.js114 LOC (<1%) 2 files
*.yml64 LOC (<1%) 2 files
*.cmd16 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 any line of content like ".*/simpletest/.*".
  • 7 files match defined criteria (1,276 lines of code, 2.9% vs. main code). All matches are in *.ts files.


*.ts1276 LOC (100%) 7 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 ".*/package[-]lock[.]json".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
    • files with paths like ".*[.]designer[.](cs|vb)".
  • 15 files match defined criteria (4,296 lines of code, 9.7% vs. main code):
    • 11 *.cs files (2,150 lines of code)
    • 4 *.json files (2,146 lines of code)
  • " *.cs" is biggest, containing 50.05% of code.
  • " *.json" is smallest, containing 49.95% of code.


*.cs2150 LOC (50%) 11 files
*.json2146 LOC (49%) 4 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 ".*[.]sh".
    • files with paths like ".*[.]nuspec".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*/AndroidManifest[.]xml".
  • 65 files match defined criteria (5,739 lines of code, 12.9% vs. main code):
    • 42 *.csproj files (3,482 lines of code)
    • 19 *.sh files (2,165 lines of code)
    • 1 *.nuspec files (47 lines of code)
    • 3 *.bat files (45 lines of code)
  • " *.csproj" is biggest, containing 60.67% of code.
  • " *.bat" is smallest, containing 0.78% of code.


*.csproj3482 LOC (60%) 42 files
*.sh2165 LOC (37%) 19 files
*.nuspec47 LOC (<1%) 1 files
*.bat45 LOC (<1%) 3 files
Other Code
csproj
plist
storyboard
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 ".*/[.]gitignore".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 205 files match defined criteria (10,545 lines of code, 23.8% vs. main code):
    • 69 *.cs files (3,752 lines of code)
    • 31 *.json files (3,442 lines of code)
    • 27 *.md files (1,423 lines of code)
    • 16 *.sh files (676 lines of code)
    • 20 *.csproj files (421 lines of code)
    • 1 *.svg files (282 lines of code)
    • 29 *.xml files (205 lines of code)
    • 6 *.plist files (132 lines of code)
    • 3 *.storyboard files (114 lines of code)
    • 1 *.yml files (55 lines of code)
    • 2 *.ps1 files (43 lines of code)
  • " *.cs" is biggest, containing 35.58% of code.
  • " *.ps1" is smallest, containing 0.41% of code.


*.cs3752 LOC (35%) 69 files
*.json3442 LOC (32%) 31 files
*.md1423 LOC (13%) 27 files
*.sh676 LOC (6%) 16 files
*.csproj421 LOC (3%) 20 files
*.svg282 LOC (2%) 1 files
*.xml205 LOC (1%) 29 files
*.plist132 LOC (1%) 6 files
*.storyboard114 LOC (1%) 3 files
*.yml55 LOC (<1%) 1 files
*.ps143 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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


2022-01-30 21:58