tensorflow / recommenders-addons
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
tpl
txt
ini
in
dockerignore
patch
  • 21 extensions are included in analyses: cuh, py, cc, sh, md, h, tpl, Dockerfile, txt, yml, bzl, hh, hpp, json, ipynb, ini, in, gitignore, dockerignore, patch, yaml
  • 8 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (2 files).
    • exclude files with path like ".*/docs/.*" (Documentation) (29 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (17 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 ".*/bin/.*" (Binaries for distribution) (1 file).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (7 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.

main65633 LOC (86%) 230 files
test6325 LOC (8%) 22 files
generated0 LOC (0%) 0 files
build and deployment656 LOC (<1%) 31 files
other3084 LOC (4%) 45 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
tpl
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 230 files match defined criteria (65,633 lines of code, 100.0% vs. main code):
    • 92 *.cuh files (40,747 lines of code)
    • 53 *.cc files (5,343 lines of code)
    • 36 *.py files (4,553 lines of code)
    • 19 *.h files (3,403 lines of code)
    • 10 *.tpl files (3,361 lines of code)
    • 4 *.hpp files (3,013 lines of code)
    • 4 *.bzl files (2,780 lines of code)
    • 4 *.hh files (1,955 lines of code)
    • 7 *.dockerfile files (476 lines of code)
    • 1 *.in files (2 lines of code)
  • " *.cuh" is biggest, containing 62.08% of code.
  • " *.in" is smallest, containing 0% of code.


*.cuh40747 LOC (62%) 92 files
*.cc5343 LOC (8%) 53 files
*.py4553 LOC (6%) 36 files
*.h3403 LOC (5%) 19 files
*.tpl3361 LOC (5%) 10 files
*.hpp3013 LOC (4%) 4 files
*.bzl2780 LOC (4%) 4 files
*.hh1955 LOC (2%) 4 files
*.dockerfile476 LOC (<1%) 7 files
*.in2 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]ests/.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 22 files match defined criteria (6,325 lines of code, 9.6% vs. main code):
    • 17 *.py files (6,268 lines of code)
    • 1 *.dockerfile files (31 lines of code)
    • 4 *.sh files (26 lines of code)
  • " *.py" is biggest, containing 99.1% of code.
  • " *.sh" is smallest, containing 0.41% of code.


*.py6268 LOC (99%) 17 files
*.dockerfile31 LOC (<1%) 1 files
*.sh26 LOC (<1%) 4 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".
  • 31 files match defined criteria (656 lines of code, 1.0% vs. main code). All matches are in *.sh files.


*.sh656 LOC (100%) 31 files
Other Code
patch
ini
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]ini".
    • files with paths like ".*[.]patch".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 45 files match defined criteria (3,084 lines of code, 4.7% vs. main code):
    • 12 *.py files (1,477 lines of code)
    • 16 *.md files (1,417 lines of code)
    • 14 *.sh files (124 lines of code)
    • 1 *.patch files (32 lines of code)
    • 1 *.json files (31 lines of code)
    • 1 *.ini files (3 lines of code)
  • " *.py" is biggest, containing 47.89% of code.
  • " *.ini" is smallest, containing 0.1% of code.


*.py1477 LOC (47%) 12 files
*.md1417 LOC (45%) 16 files
*.sh124 LOC (4%) 14 files
*.patch32 LOC (1%) 1 files
*.json31 LOC (1%) 1 files
*.ini3 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.cuh 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
  • *.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
  • *.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
  • *.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
  • *.tpl 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
  • *.hpp 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
  • *.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
  • *.hh 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
  • *.dockerfile 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
  • *.in files are analyzed with RustAnalyzer:
    • 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


2022-02-03 08:25