microsoft / python-language-server
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
pyi
csproj
resx
nuspec
gitattributes
targets
txt
editorconfig
vssettings
properties
  • 17 extensions are included in analyses: pyi, cs, py, csproj, md, json, resx, yml, nuspec, gitignore, gitattributes, targets, ps1, txt, editorconfig, vssettings, properties
  • 7 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 ".*[.]resx" (The resx resource files) (4 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (443 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) (0 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.

main75968 LOC (67%) 1106 files
test32303 LOC (28%) 311 files
generated827 LOC (<1%) 4 files
build and deployment1324 LOC (1%) 9 files
other2381 LOC (2%) 15 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
pyi
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1106 files match defined criteria (75,968 lines of code, 100.0% vs. main code):
    • 576 *.cs files (43,172 lines of code)
    • 521 *.pyi files (30,894 lines of code)
    • 5 *.py files (1,741 lines of code)
    • 2 *.yml files (136 lines of code)
    • 1 *.ps1 files (17 lines of code)
    • 1 *.targets files (8 lines of code)
  • " *.cs" is biggest, containing 56.83% of code.
  • " *.targets" is smallest, containing 0.01% of code.


*.cs43172 LOC (56%) 576 files
*.pyi30894 LOC (40%) 521 files
*.py1741 LOC (2%) 5 files
*.yml136 LOC (<1%) 2 files
*.ps117 LOC (<1%) 1 files
*.targets8 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
csproj
pyi
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.][Tt]ests[.].*".
    • files with paths like ".*/UnitTests?/.*".
    • files with paths like ".*/TestData/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 311 files match defined criteria (32,303 lines of code, 42.5% vs. main code):
    • 143 *.cs files (28,247 lines of code)
    • 158 *.py files (3,808 lines of code)
    • 6 *.csproj files (237 lines of code)
    • 4 *.pyi files (11 lines of code)
  • " *.cs" is biggest, containing 87.44% of code.
  • " *.pyi" is smallest, containing 0.03% of code.


*.cs28247 LOC (87%) 143 files
*.py3808 LOC (11%) 158 files
*.csproj237 LOC (<1%) 6 files
*.pyi11 LOC (<1%) 4 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 "[/][/][ ]*".
  • 4 files match defined criteria (827 lines of code, 1.1% vs. main code). All matches are in *.cs files.


*.cs827 LOC (100%) 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 ".*[.]csproj".
    • files with paths like ".*[.]nuspec".
  • 9 files match defined criteria (1,324 lines of code, 1.7% vs. main code):
    • 7 *.csproj files (1,278 lines of code)
    • 2 *.nuspec files (46 lines of code)
  • " *.csproj" is biggest, containing 96.53% of code.
  • " *.nuspec" is smallest, containing 3.47% of code.


*.csproj1278 LOC (96%) 7 files
*.nuspec46 LOC (3%) 2 files
Other Code
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[Dd]ocumentation/.*".
    • files with paths like ".*[.]txt".
  • 15 files match defined criteria (2,381 lines of code, 3.1% vs. main code):
    • 8 *.json files (1,687 lines of code)
    • 2 *.cs files (399 lines of code)
    • 5 *.md files (295 lines of code)
  • " *.json" is biggest, containing 70.85% of code.
  • " *.md" is smallest, containing 12.39% of code.


*.json1687 LOC (70%) 8 files
*.cs399 LOC (16%) 2 files
*.md295 LOC (12%) 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)
  • *.pyi 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
  • *.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
  • *.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
  • *.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 22:03