aws / telegraf
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
mod
proto
gitattributes
rl
  • 20 extensions are included in analyses: go, md, xml, json, txt, sh, toml, yml, h, mod, rst, c, gitignore, proto, py, gitattributes, sql, yaml, rb, rl
  • 7 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (7 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (62 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (16 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 ".*[.]txt" (Text files) (0 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
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.

main137100 LOC (53%) 667 files
test94046 LOC (36%) 363 files
generated0 LOC (0%) 0 files
build and deployment763 LOC (<1%) 18 files
other23159 LOC (9%) 257 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
rl
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 667 files match defined criteria (137,100 lines of code, 100.0% vs. main code):
    • 655 *.go files (135,186 lines of code)
    • 1 *.py files (743 lines of code)
    • 1 *.rl files (453 lines of code)
    • 2 *.proto files (305 lines of code)
    • 2 *.c files (243 lines of code)
    • 3 *.h files (74 lines of code)
    • 1 *.toml files (37 lines of code)
    • 1 *.yaml files (34 lines of code)
    • 1 *.yml files (25 lines of code)
  • " *.go" is biggest, containing 98.6% of code.
  • " *.yml" is smallest, containing 0.02% of code.


*.go135186 LOC (98%) 655 files
*.py743 LOC (<1%) 1 files
*.rl453 LOC (<1%) 1 files
*.proto305 LOC (<1%) 2 files
*.c243 LOC (<1%) 2 files
*.h74 LOC (<1%) 3 files
*.toml37 LOC (<1%) 1 files
*.yaml34 LOC (<1%) 1 files
*.yml25 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 ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 363 files match defined criteria (94,046 lines of code, 68.6% vs. main code). All matches are in *.go files.


*.go94046 LOC (100%) 363 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/docker[-]compose[.]yml".
    • files with paths like ".*/[.]gitattributes".
  • 18 files match defined criteria (763 lines of code, 0.6% vs. main code):
    • 11 *.sh files (552 lines of code)
    • 7 *.yml files (211 lines of code)
  • " *.sh" is biggest, containing 72.35% of code.
  • " *.yml" is smallest, containing 27.65% of code.


*.sh552 LOC (72%) 11 files
*.yml211 LOC (27%) 7 files
Other Code
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.](rst|rest|resttxt|rsttxt)".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 257 files match defined criteria (23,159 lines of code, 16.9% vs. main code):
    • 249 *.md files (22,679 lines of code)
    • 2 *.rst files (277 lines of code)
    • 2 *.mod files (162 lines of code)
    • 1 *.go files (17 lines of code)
    • 1 *.rb files (14 lines of code)
    • 1 *.sh files (6 lines of code)
    • 1 *.xml files (4 lines of code)
  • " *.md" is biggest, containing 97.93% of code.
  • " *.xml" is smallest, containing 0.02% of code.


*.md22679 LOC (97%) 249 files
*.rst277 LOC (1%) 2 files
*.mod162 LOC (<1%) 2 files
*.go17 LOC (<1%) 1 files
*.rb14 LOC (<1%) 1 files
*.sh6 LOC (<1%) 1 files
*.xml4 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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
  • *.rl 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
  • *.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
  • *.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
  • *.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
  • *.toml 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
  • *.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


2022-01-31 15:07