microsoft / sqltoolsservice
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
xlf
txt
csproj
props
cake
cmd
vbs
xsd
gitattributes
targets
  • 24 extensions are included in analyses: cs, html, sql, resx, xlf, txt, csproj, xml, json, md, yml, ps1, props, cake, cmd, bat, sh, vbs, xsd, js, gitattributes, targets, ipynb, gitignore
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (279 files).
    • exclude files with path like ".*/extern(al)?/.*" (Dependencies) (221 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (92 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) (67 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.

main218271 LOC (73%) 1246 files
test41942 LOC (14%) 320 files
generated13137 LOC (4%) 3 files
build and deployment479 LOC (<1%) 22 files
other23408 LOC (7%) 169 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xlf
cake
props
cmd
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1246 files match defined criteria (218,271 lines of code, 100.0% vs. main code):
    • 1,137 *.cs files (126,755 lines of code)
    • 88 *.xlf files (90,018 lines of code)
    • 4 *.cake files (794 lines of code)
    • 5 *.yml files (305 lines of code)
    • 5 *.ps1 files (276 lines of code)
    • 4 *.props files (103 lines of code)
    • 2 *.cmd files (13 lines of code)
    • 1 *.targets files (7 lines of code)
  • " *.cs" is biggest, containing 58.07% of code.
  • " *.targets" is smallest, containing 0% of code.


*.cs126755 LOC (58%) 1137 files
*.xlf90018 LOC (41%) 88 files
*.cake794 LOC (<1%) 4 files
*.yml305 LOC (<1%) 5 files
*.ps1276 LOC (<1%) 5 files
*.props103 LOC (<1%) 4 files
*.cmd13 LOC (<1%) 2 files
*.targets7 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
vbs
cmd
props
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/TestData/.*".
    • files with paths like ".*[.][Tt]ests/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 320 files match defined criteria (41,942 lines of code, 19.2% vs. main code):
    • 298 *.cs files (41,307 lines of code)
    • 13 *.csproj files (374 lines of code)
    • 3 *.bat files (97 lines of code)
    • 1 *.js files (87 lines of code)
    • 1 *.vbs files (39 lines of code)
    • 2 *.cmd files (21 lines of code)
    • 1 *.sh files (11 lines of code)
    • 1 *.props files (6 lines of code)
  • " *.cs" is biggest, containing 98.49% of code.
  • " *.props" is smallest, containing 0.01% of code.


*.cs41307 LOC (98%) 298 files
*.csproj374 LOC (<1%) 13 files
*.bat97 LOC (<1%) 3 files
*.js87 LOC (<1%) 1 files
*.vbs39 LOC (<1%) 1 files
*.cmd21 LOC (<1%) 2 files
*.sh11 LOC (<1%) 1 files
*.props6 LOC (<1%) 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 ".*[.](html|html|xhtml)" AND any line of content like "[ ]*[<]meta name[=]"generator" .*".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*[.]cs" AND any line of content like "[/][/][ ]*".
  • 3 files match defined criteria (13,137 lines of code, 6.0% vs. main code):
    • 2 *.cs files (9,696 lines of code)
    • 1 *.json files (3,441 lines of code)
  • " *.cs" is biggest, containing 73.81% of code.
  • " *.json" is smallest, containing 26.19% of code.


*.cs9696 LOC (73%) 2 files
*.json3441 LOC (26%) 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
  • 22 files match defined criteria (479 lines of code, 0.2% vs. main code):
    • 20 *.csproj files (421 lines of code)
    • 2 *.sh files (58 lines of code)
  • " *.csproj" is biggest, containing 87.89% of code.
  • " *.sh" is smallest, containing 12.11% of code.


*.csproj421 LOC (87%) 20 files
*.sh58 LOC (12%) 2 files
Other Code
xsd
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 ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 169 files match defined criteria (23,408 lines of code, 10.7% vs. main code):
    • 12 *.xml files (9,749 lines of code)
    • 144 *.sql files (7,344 lines of code)
    • 8 *.json files (3,808 lines of code)
    • 1 *.xsd files (2,290 lines of code)
    • 3 *.md files (193 lines of code)
    • 1 *.ipynb files (24 lines of code)
  • " *.xml" is biggest, containing 41.65% of code.
  • " *.ipynb" is smallest, containing 0.1% of code.


*.xml9749 LOC (41%) 12 files
*.sql7344 LOC (31%) 144 files
*.json3808 LOC (16%) 8 files
*.xsd2290 LOC (9%) 1 files
*.md193 LOC (<1%) 3 files
*.ipynb24 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)
  • *.xlf 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
  • *.cake 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)
  • *.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
  • *.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
  • *.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
  • *.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 13:48