microsoft / Analysis-Services
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
resx
csproj
xaml
txt
editorconfig
vsixmanifest
gitattributes
targets
  • 22 extensions are included in analyses: cs, js, resx, ts, json, csproj, md, sql, xaml, css, py, html, txt, bat, ps1, svg, xml, editorconfig, vsixmanifest, gitattributes, targets, gitignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (27 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (3 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (1 file).
    • 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) (4 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.

main36305 LOC (54%) 256 files
test446 LOC (<1%) 17 files
generated12323 LOC (18%) 17 files
build and deployment2569 LOC (3%) 18 files
other14777 LOC (22%) 34 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xaml
targets
vsixmanifest
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 256 files match defined criteria (36,305 lines of code, 100.0% vs. main code):
    • 209 *.cs files (33,276 lines of code)
    • 16 *.ts files (1,077 lines of code)
    • 1 *.ps1 files (465 lines of code)
    • 7 *.xaml files (441 lines of code)
    • 8 *.py files (382 lines of code)
    • 6 *.css files (217 lines of code)
    • 2 *.js files (216 lines of code)
    • 1 *.targets files (121 lines of code)
    • 5 *.html files (84 lines of code)
    • 1 *.vsixmanifest files (26 lines of code)
  • " *.cs" is biggest, containing 91.66% of code.
  • " *.vsixmanifest" is smallest, containing 0.07% of code.


*.cs33276 LOC (91%) 209 files
*.ts1077 LOC (2%) 16 files
*.ps1465 LOC (1%) 1 files
*.xaml441 LOC (1%) 7 files
*.py382 LOC (1%) 8 files
*.css217 LOC (<1%) 6 files
*.js216 LOC (<1%) 2 files
*.targets121 LOC (<1%) 1 files
*.html84 LOC (<1%) 5 files
*.vsixmanifest26 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with paths like ".*/protractor[.]conf[.]js".
    • files with paths like ".*[.]spec[.]ts".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 17 files match defined criteria (446 lines of code, 1.2% vs. main code):
    • 9 *.ts files (143 lines of code)
    • 1 *.csproj files (126 lines of code)
    • 2 *.cs files (74 lines of code)
    • 2 *.js files (54 lines of code)
    • 1 *.ps1 files (40 lines of code)
    • 2 *.bat files (9 lines of code)
  • " *.ts" is biggest, containing 32.06% of code.
  • " *.bat" is smallest, containing 2.02% of code.


*.ts143 LOC (32%) 9 files
*.csproj126 LOC (28%) 1 files
*.cs74 LOC (16%) 2 files
*.js54 LOC (12%) 2 files
*.ps140 LOC (8%) 1 files
*.bat9 LOC (2%) 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 ".*/package[-]lock[.]json".
    • files with paths like ".*[.]designer[.](cs|vb)".
  • 17 files match defined criteria (12,323 lines of code, 33.9% vs. main code):
    • 1 *.json files (11,135 lines of code)
    • 16 *.cs files (1,188 lines of code)
  • " *.json" is biggest, containing 90.36% of code.
  • " *.cs" is smallest, containing 9.64% of code.


*.json11135 LOC (90%) 1 files
*.cs1188 LOC (9%) 16 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 ".*[.]csproj".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 18 files match defined criteria (2,569 lines of code, 7.1% vs. main code):
    • 16 *.csproj files (2,563 lines of code)
    • 2 *.bat files (6 lines of code)
  • " *.csproj" is biggest, containing 99.77% of code.
  • " *.bat" is smallest, containing 0.23% of code.


*.csproj2563 LOC (99%) 16 files
*.bat6 LOC (<1%) 2 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 ".*[.]editorconfig".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 34 files match defined criteria (14,777 lines of code, 40.7% vs. main code):
    • 12 *.json files (13,977 lines of code)
    • 11 *.md files (475 lines of code)
    • 10 *.sql files (317 lines of code)
    • 1 *.xml files (8 lines of code)
  • " *.json" is biggest, containing 94.59% of code.
  • " *.xml" is smallest, containing 0.05% of code.


*.json13977 LOC (94%) 12 files
*.md475 LOC (3%) 11 files
*.sql317 LOC (2%) 10 files
*.xml8 LOC (<1%) 1 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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.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
  • *.vsixmanifest 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 14:14