microsoft / pai
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
ejs
txt
editorconfig
lua
eslintignore
dockerignore
npmrc
properties
mod
gitattributes
  • 32 extensions are included in analyses: js, py, jsx, yml, yaml, sh, java, md, json, dockerfile, svg, ejs, scss, gitignore, txt, go, editorconfig, xml, lua, tsx, bat, rb, eslintignore, ts, dockerignore, sql, npmrc, properties, mod, gitattributes, ipynb, gemspec
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (40 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (49 files).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (2 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (6 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (2 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) (9 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.

main75135 LOC (76%) 952 files
test8601 LOC (8%) 143 files
generated0 LOC (0%) 0 files
build and deployment2968 LOC (3%) 182 files
other11576 LOC (11%) 143 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
ejs
lua
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 952 files match defined criteria (75,135 lines of code, 100.0% vs. main code):
    • 186 *.jsx files (25,443 lines of code)
    • 219 *.js files (18,439 lines of code)
    • 129 *.java files (11,859 lines of code)
    • 160 *.py files (10,145 lines of code)
    • 97 *.yaml files (3,357 lines of code)
    • 107 *.yml files (1,963 lines of code)
    • 4 *.tsx files (1,265 lines of code)
    • 7 *.go files (898 lines of code)
    • 23 *.ejs files (831 lines of code)
    • 12 *.scss files (450 lines of code)
    • 1 *.rb files (226 lines of code)
    • 5 *.lua files (191 lines of code)
    • 1 *.ts files (49 lines of code)
    • 1 *.gemspec files (19 lines of code)
  • " *.jsx" is biggest, containing 33.86% of code.
  • " *.gemspec" is smallest, containing 0.03% of code.


*.jsx25443 LOC (33%) 186 files
*.js18439 LOC (24%) 219 files
*.java11859 LOC (15%) 129 files
*.py10145 LOC (13%) 160 files
*.yaml3357 LOC (4%) 97 files
*.yml1963 LOC (2%) 107 files
*.tsx1265 LOC (1%) 4 files
*.go898 LOC (1%) 7 files
*.ejs831 LOC (1%) 23 files
*.scss450 LOC (<1%) 12 files
*.rb226 LOC (<1%) 1 files
*.lua191 LOC (<1%) 5 files
*.ts49 LOC (<1%) 1 files
*.gemspec19 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 143 files match defined criteria (8,601 lines of code, 11.4% vs. main code):
    • 11 *.js files (2,720 lines of code)
    • 23 *.java files (2,171 lines of code)
    • 33 *.yaml files (1,259 lines of code)
    • 45 *.yml files (1,040 lines of code)
    • 17 *.py files (869 lines of code)
    • 2 *.go files (213 lines of code)
    • 10 *.sh files (169 lines of code)
    • 2 *.rb files (160 lines of code)
  • " *.js" is biggest, containing 31.62% of code.
  • " *.rb" is smallest, containing 1.86% of code.


*.js2720 LOC (31%) 11 files
*.java2171 LOC (25%) 23 files
*.yaml1259 LOC (14%) 33 files
*.yml1040 LOC (12%) 45 files
*.py869 LOC (10%) 17 files
*.go213 LOC (2%) 2 files
*.sh169 LOC (1%) 10 files
*.rb160 LOC (1%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
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 ".*[.]sh".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
    • files with paths like ".*[.]dockerfile".
    • files with paths like ".*/docker[-]compose[.]yaml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/pom[.]xml".
  • 182 files match defined criteria (2,968 lines of code, 4.0% vs. main code):
    • 144 *.sh files (1,630 lines of code)
    • 32 *.dockerfile files (781 lines of code)
    • 3 *.js files (481 lines of code)
    • 2 *.bat files (66 lines of code)
    • 1 *.yaml files (10 lines of code)
  • " *.sh" is biggest, containing 54.92% of code.
  • " *.yaml" is smallest, containing 0.34% of code.


*.sh1630 LOC (54%) 144 files
*.dockerfile781 LOC (26%) 32 files
*.js481 LOC (16%) 3 files
*.bat66 LOC (2%) 2 files
*.yaml10 LOC (<1%) 1 files
Other Code
properties
mod
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 ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*/LICENSE[.][a-z0-9]+".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]svg".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 143 files match defined criteria (11,576 lines of code, 15.4% vs. main code):
    • 70 *.md files (5,767 lines of code)
    • 5 *.xml files (2,037 lines of code)
    • 15 *.py files (1,612 lines of code)
    • 20 *.json files (1,078 lines of code)
    • 23 *.yaml files (910 lines of code)
    • 2 *.properties files (88 lines of code)
    • 1 *.ipynb files (37 lines of code)
    • 3 *.svg files (18 lines of code)
    • 1 *.mod files (15 lines of code)
    • 1 *.sh files (12 lines of code)
    • 2 *.sql files (2 lines of code)
  • " *.md" is biggest, containing 49.82% of code.
  • " *.sql" is smallest, containing 0.02% of code.


*.md5767 LOC (49%) 70 files
*.xml2037 LOC (17%) 5 files
*.py1612 LOC (13%) 15 files
*.json1078 LOC (9%) 20 files
*.yaml910 LOC (7%) 23 files
*.properties88 LOC (<1%) 2 files
*.ipynb37 LOC (<1%) 1 files
*.svg18 LOC (<1%) 3 files
*.mod15 LOC (<1%) 1 files
*.sh12 LOC (<1%) 1 files
*.sql2 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.jsx 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
  • *.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
  • *.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)
  • *.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
  • *.yaml 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
  • *.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
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.go files are analyzed with GoLangAnalyzer:
    • 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
  • *.ejs 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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.rb files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis
  • *.lua files are analyzed with LuaAnalyzer:
    • 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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.gemspec files are analyzed with RubyAnalyzer:
    • 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
    • Basic heuristic dependency analysis


2022-01-30 15:13