tensorflow / runtime
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
mlir
patch
proto
clang-format
txt
  • 17 extensions are included in analyses: cc, h, mlir, md, bzl, json, inc, py, svg, patch, proto, sh, cpp, yml, gitignore, clang-format, txt
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (57 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (4 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) (0 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.

main149770 LOC (89%) 835 files
test10403 LOC (6%) 105 files
generated0 LOC (0%) 0 files
build and deployment12 LOC (<1%) 1 files
other6313 LOC (3%) 35 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
mlir
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 835 files match defined criteria (149,770 lines of code, 100.0% vs. main code):
    • 180 *.mlir files (82,165 lines of code)
    • 307 *.cc files (39,937 lines of code)
    • 332 *.h files (26,564 lines of code)
    • 5 *.bzl files (509 lines of code)
    • 8 *.py files (368 lines of code)
    • 3 *.proto files (227 lines of code)
  • " *.mlir" is biggest, containing 54.86% of code.
  • " *.proto" is smallest, containing 0.15% of code.


*.mlir82165 LOC (54%) 180 files
*.cc39937 LOC (26%) 307 files
*.h26564 LOC (17%) 332 files
*.bzl509 LOC (<1%) 5 files
*.py368 LOC (<1%) 8 files
*.proto227 LOC (<1%) 3 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
mlir
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/test_.*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 105 files match defined criteria (10,403 lines of code, 6.9% vs. main code):
    • 94 *.cc files (9,879 lines of code)
    • 2 *.mlir files (335 lines of code)
    • 7 *.h files (151 lines of code)
    • 1 *.py files (33 lines of code)
    • 1 *.sh files (5 lines of code)
  • " *.cc" is biggest, containing 94.96% of code.
  • " *.sh" is smallest, containing 0.05% of code.


*.cc9879 LOC (94%) 94 files
*.mlir335 LOC (3%) 2 files
*.h151 LOC (1%) 7 files
*.py33 LOC (<1%) 1 files
*.sh5 LOC (<1%) 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 1 file matches defined criteria (12 lines of code, 0.0% vs. main code). All matches are in *.sh files.


*.sh12 LOC (100%) 1 files
Other Code
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 ".*[.]patch".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
  • 35 files match defined criteria (6,313 lines of code, 4.2% vs. main code):
    • 22 *.md files (5,173 lines of code)
    • 13 *.json files (1,140 lines of code)
  • " *.md" is biggest, containing 81.94% of code.
  • " *.json" is smallest, containing 18.06% of code.


*.md5173 LOC (81%) 22 files
*.json1140 LOC (18%) 13 files
Analyzers
Info about analyzers used for source code examinations.
  • *.mlir 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
  • *.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
  • *.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
  • *.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


2022-02-03 08:23