microsoft / AISchoolTutorials
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
cshtml
xaml
csproj
txt
resx
props
asax
cfg
  • 23 extensions are included in analyses: cs, py, cshtml, js, json, xaml, md, svg, csproj, css, txt, gitignore, html, yml, xml, resx, props, asax, ps1, sh, yaml, cfg, ts
  • 13 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (36 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (2 files).
    • exclude files with path like ".*/octicons[.]css" (Octicons) (1 file).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (4 files).
    • exclude files with path like ".*[-]vsdoc\.js" (Visual Studio IntelliSense) (0 files).
    • exclude files with path like ".*/modernizr\-\d\.\d+(\.\d+)?\.js" (Modernizr) (1 file).
    • exclude files with path like ".*[.]resx" (The resx resource files) (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).
    • exclude files with path like ".*/bootstrap[-].*" (Library) (2 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.

main44192 LOC (45%) 394 files
test6 LOC (<1%) 1 files
generated11320 LOC (11%) 3 files
build and deployment1558 LOC (1%) 21 files
other39835 LOC (41%) 42 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xaml
cshtml
props
cfg
asax
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 394 files match defined criteria (44,192 lines of code, 100.0% vs. main code):
    • 217 *.cs files (19,757 lines of code)
    • 20 *.js files (9,780 lines of code)
    • 32 *.xaml files (7,389 lines of code)
    • 55 *.py files (2,604 lines of code)
    • 41 *.cshtml files (2,198 lines of code)
    • 12 *.css files (1,334 lines of code)
    • 8 *.html files (1,006 lines of code)
    • 3 *.yml files (61 lines of code)
    • 1 *.yaml files (35 lines of code)
    • 2 *.props files (19 lines of code)
    • 1 *.cfg files (4 lines of code)
    • 1 *.ps1 files (4 lines of code)
    • 1 *.asax files (1 lines of code)
  • " *.cs" is biggest, containing 44.71% of code.
  • " *.asax" is smallest, containing 0% of code.


*.cs19757 LOC (44%) 217 files
*.js9780 LOC (22%) 20 files
*.xaml7389 LOC (16%) 32 files
*.py2604 LOC (5%) 55 files
*.cshtml2198 LOC (4%) 41 files
*.css1334 LOC (3%) 12 files
*.html1006 LOC (2%) 8 files
*.yml61 LOC (<1%) 3 files
*.yaml35 LOC (<1%) 1 files
*.props19 LOC (<1%) 2 files
*.cfg4 LOC (<1%) 1 files
*.ps14 LOC (<1%) 1 files
*.asax1 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 ".*[.][Tt]est[.].*".
    • files with paths like ".*[.]test[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 1 file matches defined criteria (6 lines of code, 0.0% vs. main code). All matches are in *.js files.


*.js6 LOC (100%) 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 "[/][/][ ]*".
    • files with paths like ".*/package[-]lock[.]json".
  • 3 files match defined criteria (11,320 lines of code, 25.6% vs. main code):
    • 1 *.json files (10,299 lines of code)
    • 2 *.cs files (1,021 lines of code)
  • " *.json" is biggest, containing 90.98% of code.
  • " *.cs" is smallest, containing 9.02% of code.


*.json10299 LOC (90%) 1 files
*.cs1021 LOC (9%) 2 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 ".*[.]csproj".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 21 files match defined criteria (1,558 lines of code, 3.5% vs. main code):
    • 20 *.csproj files (1,550 lines of code)
    • 1 *.sh files (8 lines of code)
  • " *.csproj" is biggest, containing 99.49% of code.
  • " *.sh" is smallest, containing 0.51% of code.


*.csproj1550 LOC (99%) 20 files
*.sh8 LOC (<1%) 1 files
Other Code
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 42 files match defined criteria (39,835 lines of code, 90.1% vs. main code):
    • 12 *.json files (35,208 lines of code)
    • 22 *.md files (3,925 lines of code)
    • 3 *.xml files (615 lines of code)
    • 5 *.svg files (87 lines of code)
  • " *.json" is biggest, containing 88.38% of code.
  • " *.svg" is smallest, containing 0.22% of code.


*.json35208 LOC (88%) 12 files
*.md3925 LOC (9%) 22 files
*.xml615 LOC (1%) 3 files
*.svg87 LOC (<1%) 5 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
  • *.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
  • *.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
  • *.cshtml 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
  • *.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
  • *.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
  • *.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
  • *.yaml 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
  • *.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
  • *.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
  • *.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
  • *.asax 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 22:16