microsoft / microsoft-r
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
prefs
properties
cshtml
csproj
project
classpath
snap
rds
gitattributes
txt
asax
xmi
editorconfig
xproj
babelrc
ini
  • 36 extensions are included in analyses: cs, java, md, json, js, R, ps1, prefs, xml, sh, properties, cshtml, py, csproj, gitignore, project, css, classpath, gradle, snap, rds, html, yml, sbt, bat, ipynb, gitattributes, txt, vue, asax, svg, xmi, editorconfig, xproj, babelrc, ini
  • 12 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (81 files).
    • exclude files with path like ".*/bootstrap[.](js|css|less|scss|styl)" (Bootstrap) (4 files).
    • exclude files with path like "(?i).*/jquery.*[.]js" (jQuery files) (6 files).
    • exclude files with path like ".*/jquery([^.]*)\.validate(\.unobtrusive)?\.js" (jQuery validation plugin (MS bundles this with asp.net mvc)) (0 files).
    • exclude files with path like ".*jquery[.].*[.]js" (jQuery library) (0 files).
    • exclude files with path like ".*/modernizr\-\d\.\d+(\.\d+)?\.js" (Modernizr) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (92 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (3 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.

main45943 LOC (49%) 453 files
test1290 LOC (1%) 30 files
generated10943 LOC (11%) 2 files
build and deployment1712 LOC (1%) 35 files
other33026 LOC (35%) 154 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
rds
cshtml
xproj
asax
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 453 files match defined criteria (45,943 lines of code, 100.0% vs. main code):
    • 168 *.cs files (20,267 lines of code)
    • 163 *.java files (20,174 lines of code)
    • 27 *.js files (1,715 lines of code)
    • 29 *.r files (1,412 lines of code)
    • 29 *.ps1 files (775 lines of code)
    • 3 *.rds files (445 lines of code)
    • 10 *.py files (298 lines of code)
    • 11 *.cshtml files (296 lines of code)
    • 3 *.html files (274 lines of code)
    • 2 *.vue files (154 lines of code)
    • 3 *.sbt files (60 lines of code)
    • 2 *.css files (52 lines of code)
    • 1 *.xproj files (19 lines of code)
    • 2 *.asax files (2 lines of code)
  • " *.cs" is biggest, containing 44.11% of code.
  • " *.asax" is smallest, containing 0% of code.


*.cs20267 LOC (44%) 168 files
*.java20174 LOC (43%) 163 files
*.js1715 LOC (3%) 27 files
*.r1412 LOC (3%) 29 files
*.ps1775 LOC (1%) 29 files
*.rds445 LOC (<1%) 3 files
*.py298 LOC (<1%) 10 files
*.cshtml296 LOC (<1%) 11 files
*.html274 LOC (<1%) 3 files
*.vue154 LOC (<1%) 2 files
*.sbt60 LOC (<1%) 3 files
*.css52 LOC (<1%) 2 files
*.xproj19 LOC (<1%) 1 files
*.asax2 LOC (<1%) 2 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 ".*[.]snap".
    • files with paths like ".*[.][Tt]est/.*".
    • files with paths like ".*[.][Tt]est[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*[.]spec[.]js".
    • files with any line of content like ".*/simpletest/.*".
  • 30 files match defined criteria (1,290 lines of code, 2.8% vs. main code):
    • 11 *.cs files (448 lines of code)
    • 11 *.js files (433 lines of code)
    • 7 *.java files (335 lines of code)
    • 1 *.csproj files (74 lines of code)
  • " *.cs" is biggest, containing 34.73% of code.
  • " *.csproj" is smallest, containing 5.74% of code.


*.cs448 LOC (34%) 11 files
*.js433 LOC (33%) 11 files
*.java335 LOC (25%) 7 files
*.csproj74 LOC (5%) 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 ".*/package[-]lock[.]json".
  • 2 files match defined criteria (10,943 lines of code, 23.8% vs. main code). All matches are in *.json files.


*.json10943 LOC (100%) 2 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 ".*/pom[.]xml".
    • files with paths like ".*[.]csproj".
    • files with paths like ".*[.]sh".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/AndroidManifest[.]xml".
  • 35 files match defined criteria (1,712 lines of code, 3.7% vs. main code):
    • 8 *.csproj files (794 lines of code)
    • 3 *.js files (275 lines of code)
    • 6 *.gradle files (265 lines of code)
    • 3 *.bat files (198 lines of code)
    • 15 *.sh files (180 lines of code)
  • " *.csproj" is biggest, containing 46.38% of code.
  • " *.sh" is smallest, containing 10.51% of code.


*.csproj794 LOC (46%) 8 files
*.js275 LOC (16%) 3 files
*.gradle265 LOC (15%) 6 files
*.bat198 LOC (11%) 3 files
*.sh180 LOC (10%) 15 files
Other Code
properties
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 ".*[.]properties".
    • files with paths like ".*[.]ini".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*/[Ss]amples/.*".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 154 files match defined criteria (33,026 lines of code, 71.9% vs. main code):
    • 72 *.json files (28,576 lines of code)
    • 57 *.md files (2,556 lines of code)
    • 10 *.xml files (1,148 lines of code)
    • 6 *.java files (319 lines of code)
    • 2 *.html files (290 lines of code)
    • 4 *.r files (131 lines of code)
    • 3 *.properties files (6 lines of code)
  • " *.json" is biggest, containing 86.53% of code.
  • " *.properties" is smallest, containing 0.02% of code.


*.json28576 LOC (86%) 72 files
*.md2556 LOC (7%) 57 files
*.xml1148 LOC (3%) 10 files
*.java319 LOC (<1%) 6 files
*.html290 LOC (<1%) 2 files
*.r131 LOC (<1%) 4 files
*.properties6 LOC (<1%) 3 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)
  • *.java files are analyzed with JavaAnalyzer:
    • 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 package names)
  • *.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
  • *.r files are analyzed with RAnalyzer:
    • 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
  • *.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
  • *.rds files are analyzed with RAnalyzer:
    • 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
  • *.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
  • *.cshtml 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
  • *.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
  • *.vue 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
  • *.sbt files are analyzed with ScalaAnalyzer:
    • 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
  • *.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
  • *.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
  • *.asax 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


2022-01-30 14:10