microsoft / envoy
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
proto
cfg
txt
pb
gitattributes
el
clang-format
clang-tidy
  • 26 extensions are included in analyses: cc, h, rst, proto, sh, md, yaml, py, svg, json, cfg, bzl, txt, yml, ps1, gitignore, go, pb, css, gitattributes, bat, thrift, html, el, clang-format, clang-tidy
  • 7 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 ".*/docs/.*" (Documentation) (195 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (28 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.

main99940 LOC (40%) 1080 files
test130923 LOC (53%) 686 files
generated1799 LOC (<1%) 9 files
build and deployment1196 LOC (<1%) 47 files
other12852 LOC (5%) 121 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
el
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1080 files match defined criteria (99,940 lines of code, 100.0% vs. main code):
    • 353 *.cc files (52,238 lines of code)
    • 587 *.h files (33,562 lines of code)
    • 94 *.proto files (8,753 lines of code)
    • 11 *.bzl files (2,248 lines of code)
    • 21 *.py files (2,006 lines of code)
    • 10 *.yaml files (1,036 lines of code)
    • 3 *.ps1 files (75 lines of code)
    • 1 *.el files (22 lines of code)
  • " *.cc" is biggest, containing 52.27% of code.
  • " *.el" is smallest, containing 0.02% of code.


*.cc52238 LOC (52%) 353 files
*.h33562 LOC (33%) 587 files
*.proto8753 LOC (8%) 94 files
*.bzl2248 LOC (2%) 11 files
*.py2006 LOC (2%) 21 files
*.yaml1036 LOC (1%) 10 files
*.ps175 LOC (<1%) 3 files
*.el22 LOC (<1%) 1 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
cfg
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 ".*_tests[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[-]test[-].*".
    • files with any line of content like ".*/simpletest/.*".
  • 686 files match defined criteria (130,923 lines of code, 131.0% vs. main code):
    • 458 *.cc files (117,743 lines of code)
    • 134 *.h files (9,048 lines of code)
    • 20 *.py files (1,374 lines of code)
    • 25 *.yaml files (997 lines of code)
    • 20 *.sh files (697 lines of code)
    • 12 *.proto files (547 lines of code)
    • 14 *.cfg files (435 lines of code)
    • 1 *.bzl files (33 lines of code)
    • 1 *.thrift files (30 lines of code)
    • 1 *.go files (19 lines of code)
  • " *.cc" is biggest, containing 89.93% of code.
  • " *.go" is smallest, containing 0.01% of code.


*.cc117743 LOC (89%) 458 files
*.h9048 LOC (6%) 134 files
*.py1374 LOC (1%) 20 files
*.yaml997 LOC (<1%) 25 files
*.sh697 LOC (<1%) 20 files
*.proto547 LOC (<1%) 12 files
*.cfg435 LOC (<1%) 14 files
*.bzl33 LOC (<1%) 1 files
*.thrift30 LOC (<1%) 1 files
*.go19 LOC (<1%) 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 ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
    • files with paths like ".*/gen/.*[.]go".
    • files with paths like ".*/generated/.*".
  • 9 files match defined criteria (1,799 lines of code, 1.8% vs. main code):
    • 8 *.py files (1,622 lines of code)
    • 1 *.go files (177 lines of code)
  • " *.py" is biggest, containing 90.16% of code.
  • " *.go" is smallest, containing 9.84% of code.


*.py1622 LOC (90%) 8 files
*.go177 LOC (9%) 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 ".*/[.]gitattributes".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*/docker[-]compose[.]yaml".
  • 47 files match defined criteria (1,196 lines of code, 1.2% vs. main code):
    • 46 *.sh files (1,192 lines of code)
    • 1 *.bat files (4 lines of code)
  • " *.sh" is biggest, containing 99.67% of code.
  • " *.bat" is smallest, containing 0.33% of code.


*.sh1192 LOC (99%) 46 files
*.bat4 LOC (<1%) 1 files
Other Code
pb
proto
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 ".*[.]svg".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
  • 121 files match defined criteria (12,852 lines of code, 12.9% vs. main code):
    • 1 *.svg files (4,777 lines of code)
    • 52 *.md files (3,239 lines of code)
    • 14 *.json files (1,986 lines of code)
    • 22 *.yaml files (1,270 lines of code)
    • 8 *.py files (867 lines of code)
    • 8 *.yml files (332 lines of code)
    • 2 *.go files (225 lines of code)
    • 1 *.html files (73 lines of code)
    • 2 *.pb files (33 lines of code)
    • 10 *.sh files (31 lines of code)
    • 1 *.proto files (19 lines of code)
  • " *.svg" is biggest, containing 37.17% of code.
  • " *.proto" is smallest, containing 0.15% of code.


*.svg4777 LOC (37%) 1 files
*.md3239 LOC (25%) 52 files
*.json1986 LOC (15%) 14 files
*.yaml1270 LOC (9%) 22 files
*.py867 LOC (6%) 8 files
*.yml332 LOC (2%) 8 files
*.go225 LOC (1%) 2 files
*.html73 LOC (<1%) 1 files
*.pb33 LOC (<1%) 2 files
*.sh31 LOC (<1%) 10 files
*.proto19 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cc files are analyzed with CppAnalyzer:
    • 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
  • *.h files are analyzed with CppAnalyzer:
    • 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
  • *.proto 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
  • *.bzl 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
  • *.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
  • *.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
  • *.el 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 15:17