tensorflow / tfjs-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
babelrc
plist
properties
pro
storyboard
editorconfig
txt
gitattributes
watchmanconfig
pb
  • 31 extensions are included in analyses: js, json, html, md, ts, babelrc, sh, py, gitignore, scss, xml, java, gradle, plist, css, m, properties, tsx, bat, bzl, h, pro, storyboard, xib, editorconfig, yml, svg, txt, gitattributes, watchmanconfig, pb
  • 9 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (57 files).
    • exclude files with path like ".*/dist/.*" (Distributions) (1 file).
    • 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 ".*/react(-[^.]*)?\.js" (React) (5 files).
    • exclude files with path like ".*/proguard[-]rules[.]pro" (ProGuard) (3 files).
    • exclude files with path like ".*/gradle/wrapper/.*" (Gradle) (3 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (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.

main43318 LOC (23%) 298 files
test2398 LOC (1%) 48 files
generated15 LOC (<1%) 1 files
build and deployment1061 LOC (<1%) 32 files
other137273 LOC (74%) 163 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 ".*".
  • 298 files match defined criteria (43,318 lines of code, 100.0% vs. main code):
    • 160 *.js files (18,556 lines of code)
    • 14 *.scss files (7,496 lines of code)
    • 7 *.css files (7,076 lines of code)
    • 47 *.html files (4,042 lines of code)
    • 31 *.ts files (4,004 lines of code)
    • 13 *.py files (854 lines of code)
    • 9 *.java files (511 lines of code)
    • 3 *.tsx files (388 lines of code)
    • 7 *.m files (299 lines of code)
    • 3 *.bzl files (51 lines of code)
    • 1 *.yml files (22 lines of code)
    • 3 *.h files (19 lines of code)
  • " *.js" is biggest, containing 42.84% of code.
  • " *.h" is smallest, containing 0.04% of code.


*.js18556 LOC (42%) 160 files
*.scss7496 LOC (17%) 14 files
*.css7076 LOC (16%) 7 files
*.html4042 LOC (9%) 47 files
*.ts4004 LOC (9%) 31 files
*.py854 LOC (1%) 13 files
*.java511 LOC (1%) 9 files
*.tsx388 LOC (<1%) 3 files
*.m299 LOC (<1%) 7 files
*.bzl51 LOC (<1%) 3 files
*.yml22 LOC (<1%) 1 files
*.h19 LOC (<1%) 3 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 ".*_tests[.].*".
    • files with paths like ".*/karma[.]conf[.]js".
    • files with paths like ".*/protractor[.]conf[.]js".
    • files with paths like ".*/e2e/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*[.]spec[.]ts".
    • files with paths like ".*__tests__.*".
    • files with any line of content like ".*/simpletest/.*".
  • 48 files match defined criteria (2,398 lines of code, 5.5% vs. main code):
    • 36 *.js files (1,784 lines of code)
    • 6 *.ts files (416 lines of code)
    • 4 *.py files (156 lines of code)
    • 1 *.sh files (36 lines of code)
    • 1 *.tsx files (6 lines of code)
  • " *.js" is biggest, containing 74.4% of code.
  • " *.tsx" is smallest, containing 0.25% of code.


*.js1784 LOC (74%) 36 files
*.ts416 LOC (17%) 6 files
*.py156 LOC (6%) 4 files
*.sh36 LOC (1%) 1 files
*.tsx6 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 ".*/generated/.*".
  • 1 file matches defined criteria (15 lines of code, 0.0% vs. main code). All matches are in *.java files.


*.java15 LOC (100%) 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 ".*/package[.]json".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]gradle".
    • files with paths like ".*/AndroidManifest[.]xml".
    • files with paths like ".*[.]bat".
    • files with paths like ".*/[.]gitattributes".
    • files with paths like ".*([.]|/)webpack([.]|/).*".
  • 32 files match defined criteria (1,061 lines of code, 2.4% vs. main code):
    • 19 *.sh files (448 lines of code)
    • 9 *.gradle files (378 lines of code)
    • 3 *.bat files (224 lines of code)
    • 1 *.js files (11 lines of code)
  • " *.sh" is biggest, containing 42.22% of code.
  • " *.js" is smallest, containing 1.04% of code.


*.sh448 LOC (42%) 19 files
*.gradle378 LOC (35%) 9 files
*.bat224 LOC (21%) 3 files
*.js11 LOC (1%) 1 files
Other Code
plist
storyboard
properties
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 ".*[.]editorconfig".
    • files with paths like ".*[.]svg".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]storyboard".
    • files with paths like ".*[.]properties".
    • files with paths like ".*[.](xml|xsd|robot|sql|pgsql|dashboard|profile|ipynb|raml|avsc|al)".
  • 163 files match defined criteria (137,273 lines of code, 316.9% vs. main code):
    • 87 *.json files (134,114 lines of code)
    • 45 *.md files (2,459 lines of code)
    • 8 *.plist files (233 lines of code)
    • 3 *.storyboard files (226 lines of code)
    • 14 *.xml files (90 lines of code)
    • 2 *.xib files (84 lines of code)
    • 3 *.properties files (66 lines of code)
    • 1 *.svg files (1 lines of code)
  • " *.json" is biggest, containing 97.7% of code.
  • " *.svg" is smallest, containing 0% of code.


*.json134114 LOC (97%) 87 files
*.md2459 LOC (1%) 45 files
*.plist233 LOC (<1%) 8 files
*.storyboard226 LOC (<1%) 3 files
*.xml90 LOC (<1%) 14 files
*.xib84 LOC (<1%) 2 files
*.properties66 LOC (<1%) 3 files
*.svg1 LOC (<1%) 1 files
Analyzers
Info about analyzers used for source code examinations.
  • *.js files are analyzed with JavaScriptAnalyzer:
    • 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
  • *.scss files are analyzed with ScssAnalyzer:
    • 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
  • *.css files are analyzed with CssAnalyzer:
    • 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
  • *.html files are analyzed with HtmlAnalyzer:
    • 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
  • *.ts files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.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
  • *.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)
  • *.tsx files are analyzed with TypeScriptAnalyzer:
    • 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
  • *.m 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
  • *.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
  • *.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


2022-02-03 08:04