microsoft / pxt-blockly
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
txt
npmignore
xsd
editorconfig
npmrc
clang-format
lua
eslintignore
  • 22 extensions are included in analyses: js, json, ts, html, svg, xml, py, sh, md, yml, txt, npmignore, xsd, ps1, dart, editorconfig, npmrc, gitignore, clang-format, lua, php, eslintignore
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (18 files).
    • exclude files with path like ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*\.d\.ts" (Typescript definition files) (133 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.

main105458 LOC (49%) 455 files
test31475 LOC (14%) 102 files
generated12886 LOC (6%) 1 files
build and deployment151 LOC (<1%) 3 files
other62009 LOC (29%) 161 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 455 files match defined criteria (105,458 lines of code, 100.0% vs. main code):
    • 444 *.js files (104,968 lines of code)
    • 9 *.py files (481 lines of code)
    • 1 *.ps1 files (7 lines of code)
    • 1 *.yml files (2 lines of code)
  • " *.js" is biggest, containing 99.54% of code.
  • " *.yml" is smallest, containing 0% of code.


*.js104968 LOC (99%) 444 files
*.py481 LOC (<1%) 9 files
*.ps17 LOC (<1%) 1 files
*.yml2 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
lua
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 102 files match defined criteria (31,475 lines of code, 29.8% vs. main code):
    • 72 *.js files (21,777 lines of code)
    • 19 *.html files (3,823 lines of code)
    • 1 *.lua files (1,561 lines of code)
    • 1 *.php files (1,458 lines of code)
    • 1 *.dart files (1,452 lines of code)
    • 1 *.py files (1,236 lines of code)
    • 7 *.sh files (168 lines of code)
  • " *.js" is biggest, containing 69.19% of code.
  • " *.sh" is smallest, containing 0.53% of code.


*.js21777 LOC (69%) 72 files
*.html3823 LOC (12%) 19 files
*.lua1561 LOC (4%) 1 files
*.php1458 LOC (4%) 1 files
*.dart1452 LOC (4%) 1 files
*.py1236 LOC (3%) 1 files
*.sh168 LOC (<1%) 7 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".
  • 1 file matches defined criteria (12,886 lines of code, 12.2% vs. main code). All matches are in *.json files.


*.json12886 LOC (100%) 1 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 ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/package[-]lock[.]json".
    • files with paths like ".*/package[.]json".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 3 files match defined criteria (151 lines of code, 0.1% vs. main code):
    • 1 *.js files (84 lines of code)
    • 2 *.sh files (67 lines of code)
  • " *.js" is biggest, containing 55.63% of code.
  • " *.sh" is smallest, containing 44.37% of code.


*.js84 LOC (55%) 1 files
*.sh67 LOC (44%) 2 files
Other Code
xsd
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*/[.]eslintignore".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]npmignore".
    • files with paths like ".*[.]npmrc".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 161 files match defined criteria (62,009 lines of code, 58.8% vs. main code):
    • 128 *.json files (41,299 lines of code)
    • 13 *.xml files (19,735 lines of code)
    • 14 *.svg files (678 lines of code)
    • 1 *.xsd files (159 lines of code)
    • 5 *.md files (138 lines of code)
  • " *.json" is biggest, containing 66.6% of code.
  • " *.md" is smallest, containing 0.22% of code.


*.json41299 LOC (66%) 128 files
*.xml19735 LOC (31%) 13 files
*.svg678 LOC (1%) 14 files
*.xsd159 LOC (<1%) 1 files
*.md138 LOC (<1%) 5 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.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


2022-01-30 14:33