microsoft / mattercenter
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
csproj
feature
xproj
resx
txt
cmd
ps
targets
aspx
xaml
  • 22 extensions are included in analyses: cs, js, html, ps1, css, xml, json, csproj, feature, xproj, resx, bat, svg, txt, md, htm, cmd, ps, targets, aspx, gitignore, xaml
  • 10 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (1 file).
    • exclude files with path like ".*[.]resx" (The resx resource files) (7 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (3 files).
    • exclude files with path like ".*[.]min[.]js" (Minimized JS library) (1 file).
    • exclude files with path like ".*/angular([^.]*)\.js" (AngularJS) (1 file).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 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) (3 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.

main91980 LOC (12%) 448 files
test4525 LOC (<1%) 36 files
generated2260 LOC (<1%) 14 files
build and deployment3939 LOC (<1%) 29 files
other631452 LOC (86%) 56 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
xaml
xproj
aspx
targets
cmd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 448 files match defined criteria (91,980 lines of code, 100.0% vs. main code):
    • 279 *.cs files (39,288 lines of code)
    • 46 *.js files (24,949 lines of code)
    • 27 *.css files (14,923 lines of code)
    • 51 *.html files (7,550 lines of code)
    • 31 *.ps1 files (4,611 lines of code)
    • 1 *.xaml files (259 lines of code)
    • 9 *.xproj files (186 lines of code)
    • 1 *.aspx files (107 lines of code)
    • 1 *.targets files (104 lines of code)
    • 2 *.cmd files (3 lines of code)
  • " *.cs" is biggest, containing 42.71% of code.
  • " *.cmd" is smallest, containing 0% of code.


*.cs39288 LOC (42%) 279 files
*.js24949 LOC (27%) 46 files
*.css14923 LOC (16%) 27 files
*.html7550 LOC (8%) 51 files
*.ps14611 LOC (5%) 31 files
*.xaml259 LOC (<1%) 1 files
*.xproj186 LOC (<1%) 9 files
*.aspx107 LOC (<1%) 1 files
*.targets104 LOC (<1%) 1 files
*.cmd3 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
feature
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Ss]pecs/.*".
    • files with paths like ".*[.]spec[.]js".
    • files with paths like ".*[.]feature".
    • files with paths like ".*/IntegrationTests?/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 36 files match defined criteria (4,525 lines of code, 4.9% vs. main code):
    • 17 *.js files (2,868 lines of code)
    • 7 *.cs files (1,255 lines of code)
    • 12 *.feature files (402 lines of code)
  • " *.js" is biggest, containing 63.38% of code.
  • " *.feature" is smallest, containing 8.88% of code.


*.js2868 LOC (63%) 17 files
*.cs1255 LOC (27%) 7 files
*.feature402 LOC (8%) 12 files
Generated Code
Automatically generated files, not manually changed after generation.
ps
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 ".*[.](ps|eps|pfa)".
    • files with paths like ".*[.]designer[.](cs|vb)".
    • files with paths like ".*[.]feature[.]cs".
  • 14 files match defined criteria (2,260 lines of code, 2.5% vs. main code):
    • 13 *.cs files (2,209 lines of code)
    • 1 *.ps files (51 lines of code)
  • " *.cs" is biggest, containing 97.74% of code.
  • " *.ps" is smallest, containing 2.26% of code.


*.cs2209 LOC (97%) 13 files
*.ps51 LOC (2%) 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 ".*/[.]gitignore".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/package[.]json".
  • 29 files match defined criteria (3,939 lines of code, 4.3% vs. main code):
    • 24 *.csproj files (3,914 lines of code)
    • 5 *.bat files (25 lines of code)
  • " *.csproj" is biggest, containing 99.37% of code.
  • " *.bat" is smallest, containing 0.63% of code.


*.csproj3914 LOC (99%) 24 files
*.bat25 LOC (<1%) 5 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 ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 56 files match defined criteria (631,452 lines of code, 686.5% vs. main code):
    • 30 *.xml files (628,962 lines of code)
    • 24 *.json files (2,393 lines of code)
    • 2 *.md files (97 lines of code)
  • " *.xml" is biggest, containing 99.61% of code.
  • " *.md" is smallest, containing 0.02% of code.


*.xml628962 LOC (99%) 30 files
*.json2393 LOC (<1%) 24 files
*.md97 LOC (<1%) 2 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)
  • *.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
  • *.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
  • *.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
  • *.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
  • *.xproj 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
  • *.aspx 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
  • *.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


2022-01-30 11:13