tensorflow / examples
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
properties
txt
pro
storyboard
plist
pb
proto
editorconfig
  • 29 extensions are included in analyses: xml, py, swift, java, json, gradle, kt, md, ipynb, properties, txt, pro, gitignore, storyboard, sh, bat, plist, svg, cc, h, pb, js, mm, cpp, proto, css, editorconfig, html, m
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (28 files).
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (96 files).
    • exclude files with path like ".*/testdata/.*" (Test data) (18 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (29 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (23 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) (36 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.

main7982 LOC (5%) 97 files
test3442 LOC (2%) 40 files
generated0 LOC (0%) 0 files
build and deployment762 LOC (<1%) 22 files
other122686 LOC (90%) 1195 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 97 files match defined criteria (7,982 lines of code, 100.0% vs. main code):
    • 93 *.py files (7,660 lines of code)
    • 4 *.kt files (322 lines of code)
  • " *.py" is biggest, containing 95.97% of code.
  • " *.kt" is smallest, containing 4.03% of code.


*.py7660 LOC (95%) 93 files
*.kt322 LOC (4%) 4 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 paths like ".*/src/androidTest/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with any line of content like ".*/simpletest/.*".
  • 40 files match defined criteria (3,442 lines of code, 43.1% vs. main code):
    • 38 *.py files (3,354 lines of code)
    • 2 *.sh files (88 lines of code)
  • " *.py" is biggest, containing 97.44% of code.
  • " *.sh" is smallest, containing 2.56% of code.


*.py3354 LOC (97%) 38 files
*.sh88 LOC (2%) 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
  • 22 files match defined criteria (762 lines of code, 9.5% vs. main code):
    • 5 *.bat files (340 lines of code)
    • 12 *.gradle files (250 lines of code)
    • 5 *.sh files (172 lines of code)
  • " *.bat" is biggest, containing 44.62% of code.
  • " *.sh" is smallest, containing 22.57% of code.


*.bat340 LOC (44%) 5 files
*.gradle250 LOC (32%) 12 files
*.sh172 LOC (22%) 5 files
Other Code
storyboard
plist
properties
proto
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 ".*/[.]gitignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[Dd]emos?/.*".
    • files with paths like ".*[.]properties".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 1195 files match defined criteria (122,686 lines of code, 1537.0% vs. main code):
    • 77 *.json files (33,940 lines of code)
    • 49 *.ipynb files (24,090 lines of code)
    • 136 *.java files (14,620 lines of code)
    • 326 *.xml files (10,512 lines of code)
    • 141 *.swift files (9,990 lines of code)
    • 78 *.kt files (7,440 lines of code)
    • 93 *.py files (7,195 lines of code)
    • 61 *.md files (3,419 lines of code)
    • 25 *.storyboard files (3,116 lines of code)
    • 87 *.gradle files (2,221 lines of code)
    • 13 *.cc files (1,604 lines of code)
    • 18 *.bat files (1,224 lines of code)
    • 15 *.plist files (735 lines of code)
    • 4 *.js files (467 lines of code)
    • 23 *.properties files (397 lines of code)
    • 16 *.sh files (357 lines of code)
    • 11 *.h files (273 lines of code)
    • 1 *.css files (260 lines of code)
    • 4 *.mm files (218 lines of code)
    • 1 *.html files (204 lines of code)
    • 2 *.cpp files (157 lines of code)
    • 1 *.m files (129 lines of code)
    • 1 *.proto files (60 lines of code)
    • 12 *.svg files (58 lines of code)
  • " *.json" is biggest, containing 27.66% of code.
  • " *.svg" is smallest, containing 0.05% of code.


*.json33940 LOC (27%) 77 files
*.ipynb24090 LOC (19%) 49 files
*.java14620 LOC (11%) 136 files
*.xml10512 LOC (8%) 326 files
*.swift9990 LOC (8%) 141 files
*.kt7440 LOC (6%) 78 files
*.py7195 LOC (5%) 93 files
*.md3419 LOC (2%) 61 files
*.storyboard3116 LOC (2%) 25 files
*.gradle2221 LOC (1%) 87 files
*.cc1604 LOC (1%) 13 files
*.bat1224 LOC (<1%) 18 files
*.plist735 LOC (<1%) 15 files
*.js467 LOC (<1%) 4 files
*.properties397 LOC (<1%) 23 files
*.sh357 LOC (<1%) 16 files
*.h273 LOC (<1%) 11 files
*.css260 LOC (<1%) 1 files
*.mm218 LOC (<1%) 4 files
*.html204 LOC (<1%) 1 files
*.cpp157 LOC (<1%) 2 files
*.m129 LOC (<1%) 1 files
*.proto60 LOC (<1%) 1 files
*.svg58 LOC (<1%) 12 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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
  • *.kt files are analyzed with KotlinAnalyzer:
    • 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 (based on imports and package statements)


2022-02-03 08:06