microsoft / VSSDK-Extensibility-Samples
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
vsixmanifest
xaml
gitattributes
targets
vstemplate
txt
xsd
patch
diff
  • 20 extensions are included in analyses: cs, resx, csproj, md, vsixmanifest, xaml, xml, json, h, gitattributes, targets, cpp, vstemplate, gitignore, txt, xsd, ps1, patch, yml, diff
  • 6 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) (62 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) (1 file).
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.

main30291 LOC (65%) 441 files
test0 LOC (0%) 0 files
generated2866 LOC (6%) 24 files
build and deployment10236 LOC (22%) 57 files
other2818 LOC (6%) 61 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
vsixmanifest
xaml
vstemplate
targets
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 441 files match defined criteria (30,291 lines of code, 100.0% vs. main code):
    • 369 *.cs files (26,696 lines of code)
    • 2 *.cpp files (1,140 lines of code)
    • 46 *.vsixmanifest files (1,029 lines of code)
    • 15 *.xaml files (710 lines of code)
    • 3 *.h files (612 lines of code)
    • 2 *.vstemplate files (52 lines of code)
    • 1 *.ps1 files (37 lines of code)
    • 1 *.yml files (9 lines of code)
    • 2 *.targets files (6 lines of code)
  • " *.cs" is biggest, containing 88.13% of code.
  • " *.targets" is smallest, containing 0.02% of code.


*.cs26696 LOC (88%) 369 files
*.cpp1140 LOC (3%) 2 files
*.vsixmanifest1029 LOC (3%) 46 files
*.xaml710 LOC (2%) 15 files
*.h612 LOC (2%) 3 files
*.vstemplate52 LOC (<1%) 2 files
*.ps137 LOC (<1%) 1 files
*.yml9 LOC (<1%) 1 files
*.targets6 LOC (<1%) 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 "[/][/][ ]*".
  • 24 files match defined criteria (2,866 lines of code, 9.5% vs. main code). All matches are in *.cs files.


*.cs2866 LOC (100%) 24 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".
  • 57 files match defined criteria (10,236 lines of code, 33.8% vs. main code). All matches are in *.csproj files.


*.csproj10236 LOC (100%) 57 files
Other Code
xsd
patch
diff
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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]diff".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 61 files match defined criteria (2,818 lines of code, 9.3% vs. main code):
    • 51 *.md files (2,319 lines of code)
    • 5 *.xml files (389 lines of code)
    • 1 *.xsd files (71 lines of code)
    • 2 *.json files (23 lines of code)
    • 1 *.patch files (8 lines of code)
    • 1 *.diff files (8 lines of code)
  • " *.md" is biggest, containing 82.29% of code.
  • " *.diff" is smallest, containing 0.28% of code.


*.md2319 LOC (82%) 51 files
*.xml389 LOC (13%) 5 files
*.xsd71 LOC (2%) 1 files
*.json23 LOC (<1%) 2 files
*.patch8 LOC (<1%) 1 files
*.diff8 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)
  • *.cpp 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
  • *.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
  • *.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
  • *.vstemplate 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
  • *.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
  • *.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
  • *.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 10:19