microsoft / edx-configuration
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
cfg
ini
vim
mk
dockerignore
gitattributes
TXT
editorconfig
  • 22 extensions are included in analyses: yml, sh, py, md, json, txt, cfg, xml, groovy, yaml, ini, vim, c, rst, mk, gitignore, tf, dockerignore, gitattributes, sql, TXT, editorconfig
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (8 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) (16 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.

main72608 LOC (88%) 1648 files
test711 LOC (<1%) 34 files
generated0 LOC (0%) 0 files
build and deployment2620 LOC (3%) 41 files
other5828 LOC (7%) 78 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
txt
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1648 files match defined criteria (72,608 lines of code, 100.0% vs. main code):
    • 1,582 *.yml files (64,766 lines of code)
    • 37 *.py files (6,260 lines of code)
    • 8 *.groovy files (556 lines of code)
    • 1 *.txt files (553 lines of code)
    • 2 *.tf files (151 lines of code)
    • 5 *.yaml files (133 lines of code)
    • 4 *.c files (124 lines of code)
    • 9 *.cfg files (65 lines of code)
  • " *.yml" is biggest, containing 89.2% of code.
  • " *.cfg" is smallest, containing 0.09% of code.


*.yml64766 LOC (89%) 1582 files
*.py6260 LOC (8%) 37 files
*.groovy556 LOC (<1%) 8 files
*.txt553 LOC (<1%) 1 files
*.tf151 LOC (<1%) 2 files
*.yaml133 LOC (<1%) 5 files
*.c124 LOC (<1%) 4 files
*.cfg65 LOC (<1%) 9 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 34 files match defined criteria (711 lines of code, 1.0% vs. main code):
    • 25 *.yml files (407 lines of code)
    • 6 *.sh files (163 lines of code)
    • 1 *.py files (127 lines of code)
    • 2 *.cfg files (14 lines of code)
  • " *.yml" is biggest, containing 57.24% of code.
  • " *.cfg" is smallest, containing 1.97% of code.


*.yml407 LOC (57%) 25 files
*.sh163 LOC (22%) 6 files
*.py127 LOC (17%) 1 files
*.cfg14 LOC (1%) 2 files
Build and Deployment Code
Source code used to configure or support build and deployment process.
mk
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 ".*[.]mk".
    • files with paths like ".*[.]sh".
    • files with paths like ".*/docker[-]compose[.]yml".
  • 41 files match defined criteria (2,620 lines of code, 3.6% vs. main code):
    • 38 *.sh files (2,436 lines of code)
    • 2 *.mk files (106 lines of code)
    • 1 *.yml files (78 lines of code)
  • " *.sh" is biggest, containing 92.98% of code.
  • " *.yml" is smallest, containing 2.98% of code.


*.sh2436 LOC (92%) 38 files
*.mk106 LOC (4%) 2 files
*.yml78 LOC (2%) 1 files
Other Code
ini
vim
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]vim".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 78 files match defined criteria (5,828 lines of code, 8.0% vs. main code):
    • 18 *.json files (2,742 lines of code)
    • 24 *.md files (2,119 lines of code)
    • 8 *.xml files (452 lines of code)
    • 16 *.yml files (368 lines of code)
    • 5 *.ini files (54 lines of code)
    • 4 *.vim files (44 lines of code)
    • 2 *.rst files (37 lines of code)
    • 1 *.sql files (12 lines of code)
  • " *.json" is biggest, containing 47.05% of code.
  • " *.sql" is smallest, containing 0.21% of code.


*.json2742 LOC (47%) 18 files
*.md2119 LOC (36%) 24 files
*.xml452 LOC (7%) 8 files
*.yml368 LOC (6%) 16 files
*.ini54 LOC (<1%) 5 files
*.vim44 LOC (<1%) 4 files
*.rst37 LOC (<1%) 2 files
*.sql12 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.groovy files are analyzed with GroovyAnalyzer:
    • 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
  • *.txt 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
  • *.tf 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
  • *.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
  • *.c files are analyzed with CStyleAnalyzer:
    • 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
  • *.cfg files are analyzed with CfgAnalyzer:
    • 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 13:50