bazelbuild / rules_apple
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
plist
storyboard
txt
metal
  • 20 extensions are included in analyses: bzl, json, plist, sh, swift, m, py, storyboard, md, h, txt, xib, cc, xml, d, metal, yml, yaml, gitignore, bash
  • 6 criteria are used to exclude files from analysis:
    • 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 ".*/testdata/.*" (Test data) (46 files).
    • exclude files with path like ".*/sokrates_conventions[.]json" (Sokrates scoping conventions) (1 file).
    • exclude files with path like ".*[.]txt" (Text files) (10 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.

main30674 LOC (50%) 132 files
test17612 LOC (29%) 130 files
generated0 LOC (0%) 0 files
build and deployment243 LOC (<1%) 6 files
other11717 LOC (19%) 232 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 ".*".
  • 132 files match defined criteria (30,674 lines of code, 100.0% vs. main code):
    • 112 *.bzl files (25,527 lines of code)
    • 20 *.py files (5,147 lines of code)
  • " *.bzl" is biggest, containing 83.22% of code.
  • " *.py" is smallest, containing 16.78% of code.


*.bzl25527 LOC (83%) 112 files
*.py5147 LOC (16%) 20 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
metal
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 130 files match defined criteria (17,612 lines of code, 57.4% vs. main code):
    • 48 *.sh files (9,167 lines of code)
    • 56 *.bzl files (7,478 lines of code)
    • 1 *.bash files (451 lines of code)
    • 3 *.py files (303 lines of code)
    • 8 *.swift files (101 lines of code)
    • 4 *.m files (44 lines of code)
    • 3 *.cc files (39 lines of code)
    • 3 *.h files (19 lines of code)
    • 2 *.d files (6 lines of code)
    • 2 *.metal files (4 lines of code)
  • " *.sh" is biggest, containing 52.05% of code.
  • " *.metal" is smallest, containing 0.02% of code.


*.sh9167 LOC (52%) 48 files
*.bzl7478 LOC (42%) 56 files
*.bash451 LOC (2%) 1 files
*.py303 LOC (1%) 3 files
*.swift101 LOC (<1%) 8 files
*.m44 LOC (<1%) 4 files
*.cc39 LOC (<1%) 3 files
*.h19 LOC (<1%) 3 files
*.d6 LOC (<1%) 2 files
*.metal4 LOC (<1%) 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 ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
  • 6 files match defined criteria (243 lines of code, 0.8% vs. main code). All matches are in *.sh files.


*.sh243 LOC (100%) 6 files
Other Code
storyboard
plist
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 ".*[.]storyboard".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]plist".
    • files with paths like ".*[.]xib".
    • files with paths like ".*[.]txt".
  • 232 files match defined criteria (11,717 lines of code, 38.2% vs. main code):
    • 22 *.md files (3,576 lines of code)
    • 20 *.storyboard files (3,574 lines of code)
    • 56 *.json files (1,786 lines of code)
    • 55 *.plist files (1,377 lines of code)
    • 28 *.m files (558 lines of code)
    • 26 *.swift files (377 lines of code)
    • 6 *.xib files (372 lines of code)
    • 19 *.h files (97 lines of code)
  • " *.md" is biggest, containing 30.52% of code.
  • " *.h" is smallest, containing 0.83% of code.


*.md3576 LOC (30%) 22 files
*.storyboard3574 LOC (30%) 20 files
*.json1786 LOC (15%) 56 files
*.plist1377 LOC (11%) 55 files
*.m558 LOC (4%) 28 files
*.swift377 LOC (3%) 26 files
*.xib372 LOC (3%) 6 files
*.h97 LOC (<1%) 19 files
Analyzers
Info about analyzers used for source code examinations.
  • *.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


2022-02-03 05:30