awslabs / amazon-kinesis-producer
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
proto
properties
  • 13 extensions are included in analyses: cc, h, java, md, gitignore, txt, xml, proto, yml, py, sh, json, properties
  • 5 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (6 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) (2 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.

main8881 LOC (19%) 90 files
test4382 LOC (9%) 27 files
generated29998 LOC (67%) 6 files
build and deployment201 LOC (<1%) 1 files
other1180 LOC (2%) 10 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 90 files match defined criteria (8,881 lines of code, 100.0% vs. main code):
    • 40 *.h files (3,431 lines of code)
    • 25 *.java files (2,771 lines of code)
    • 22 *.cc files (2,435 lines of code)
    • 2 *.proto files (135 lines of code)
    • 1 *.py files (109 lines of code)
  • " *.h" is biggest, containing 38.63% of code.
  • " *.py" is smallest, containing 1.23% of code.


*.h3431 LOC (38%) 40 files
*.java2771 LOC (31%) 25 files
*.cc2435 LOC (27%) 22 files
*.proto135 LOC (1%) 2 files
*.py109 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[-]data/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with any line of content like ".*/simpletest/.*".
  • 27 files match defined criteria (4,382 lines of code, 49.3% vs. main code):
    • 20 *.cc files (3,754 lines of code)
    • 6 *.java files (587 lines of code)
    • 1 *.h files (41 lines of code)
  • " *.cc" is biggest, containing 85.67% of code.
  • " *.h" is smallest, containing 0.94% of code.


*.cc3754 LOC (85%) 20 files
*.java587 LOC (13%) 6 files
*.h41 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[!].*".
  • 6 files match defined criteria (29,998 lines of code, 337.8% vs. main code):
    • 2 *.java files (16,711 lines of code)
    • 2 *.h files (7,036 lines of code)
    • 2 *.cc files (6,251 lines of code)
  • " *.java" is biggest, containing 55.71% of code.
  • " *.cc" is smallest, containing 20.84% of code.


*.java16711 LOC (55%) 2 files
*.h7036 LOC (23%) 2 files
*.cc6251 LOC (20%) 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 ".*/pom[.]xml".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 1 file matches defined criteria (201 lines of code, 2.3% vs. main code). All matches are in *.sh files.


*.sh201 LOC (100%) 1 files
Other Code
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 10 files match defined criteria (1,180 lines of code, 13.3% vs. main code):
    • 7 *.md files (637 lines of code)
    • 1 *.properties files (281 lines of code)
    • 2 *.xml files (262 lines of code)
  • " *.md" is biggest, containing 53.98% of code.
  • " *.xml" is smallest, containing 22.2% of code.


*.md637 LOC (53%) 7 files
*.properties281 LOC (23%) 1 files
*.xml262 LOC (22%) 2 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.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)
  • *.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
  • *.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
  • *.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


2022-01-31 18:05