microsoft / accessibility-insights-windows
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
xaml
csproj
resx
targets
txt
wixproj
gitattributes
wxs
cmd
  • 17 extensions are included in analyses: cs, xaml, csproj, md, resx, json, targets, yml, html, txt, ps1, wixproj, gitattributes, gitignore, Json, wxs, cmd
  • 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 ".*/docs/.*" (Documentation) (14 files).
    • exclude files with path like ".*[.]resx" (The resx resource files) (9 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) (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.

main40775 LOC (82%) 416 files
test2071 LOC (4%) 29 files
generated3972 LOC (8%) 10 files
build and deployment729 LOC (1%) 18 files
other1798 LOC (3%) 12 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
wixproj
cmd
wxs
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 416 files match defined criteria (40,775 lines of code, 100.0% vs. main code):
    • 328 *.cs files (32,022 lines of code)
    • 69 *.xaml files (7,768 lines of code)
    • 3 *.yml files (369 lines of code)
    • 2 *.ps1 files (205 lines of code)
    • 4 *.html files (129 lines of code)
    • 6 *.targets files (100 lines of code)
    • 1 *.wixproj files (78 lines of code)
    • 1 *.cmd files (43 lines of code)
    • 1 *.wxs files (34 lines of code)
    • 1 *.json files (27 lines of code)
  • " *.cs" is biggest, containing 78.53% of code.
  • " *.json" is smallest, containing 0.07% of code.


*.cs32022 LOC (78%) 328 files
*.xaml7768 LOC (19%) 69 files
*.yml369 LOC (<1%) 3 files
*.ps1205 LOC (<1%) 2 files
*.html129 LOC (<1%) 4 files
*.targets100 LOC (<1%) 6 files
*.wixproj78 LOC (<1%) 1 files
*.cmd43 LOC (<1%) 1 files
*.wxs34 LOC (<1%) 1 files
*.json27 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 ".*[-]test[-].*".
    • files with paths like ".*/UITests?/.*".
    • files with any line of content like ".*/simpletest/.*".
    • files with paths like ".*UnitTests/.*".
  • 29 files match defined criteria (2,071 lines of code, 5.1% vs. main code):
    • 22 *.cs files (1,874 lines of code)
    • 6 *.csproj files (153 lines of code)
    • 1 *.yml files (44 lines of code)
  • " *.cs" is biggest, containing 90.49% of code.
  • " *.yml" is smallest, containing 2.12% of code.


*.cs1874 LOC (90%) 22 files
*.csproj153 LOC (7%) 6 files
*.yml44 LOC (2%) 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 "[/][/][ ]*".
  • 10 files match defined criteria (3,972 lines of code, 9.7% vs. main code). All matches are in *.cs files.


*.cs3972 LOC (100%) 10 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".
  • 18 files match defined criteria (729 lines of code, 1.8% vs. main code). All matches are in *.csproj files.


*.csproj729 LOC (100%) 18 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 ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
  • 12 files match defined criteria (1,798 lines of code, 4.4% vs. main code):
    • 7 *.json files (1,669 lines of code)
    • 5 *.md files (129 lines of code)
  • " *.json" is biggest, containing 92.83% of code.
  • " *.md" is smallest, containing 7.17% of code.


*.json1669 LOC (92%) 7 files
*.md129 LOC (7%) 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.wixproj 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
  • *.wxs 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
  • *.json files are analyzed with JsonAnalyzer:
    • 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:31