bazelbuild / rules_swift
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
proto
clang-format
patch
txt
  • 16 extensions are included in analyses: bzl, swift, h, cc, md, sh, proto, c, m, gitignore, clang-format, patch, txt, json, yml, yaml
  • 6 criteria are used to exclude files from analysis:
    • exclude files with path like ".*/(3rd|[Tt]hird)[-_]?[Pp]arty/.*" (Dependencies) (3 files).
    • exclude files with path like ".*/[.][a-zA-Z0-9_]+.*" (Hidden files and folders) (5 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.

main11519 LOC (79%) 56 files
test2328 LOC (16%) 27 files
generated0 LOC (0%) 0 files
build and deployment31 LOC (<1%) 2 files
other583 LOC (4%) 26 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 ".*".
  • 56 files match defined criteria (11,519 lines of code, 100.0% vs. main code):
    • 35 *.bzl files (10,373 lines of code)
    • 11 *.cc files (908 lines of code)
    • 10 *.h files (238 lines of code)
  • " *.bzl" is biggest, containing 90.05% of code.
  • " *.h" is smallest, containing 2.07% of code.


*.bzl10373 LOC (90%) 35 files
*.cc908 LOC (7%) 11 files
*.h238 LOC (2%) 10 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 ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
    • files with any line of content like ".*/simpletest/.*".
  • 27 files match defined criteria (2,328 lines of code, 20.2% vs. main code):
    • 16 *.bzl files (2,317 lines of code)
    • 6 *.swift files (6 lines of code)
    • 3 *.h files (3 lines of code)
    • 2 *.c files (2 lines of code)
  • " *.bzl" is biggest, containing 99.53% of code.
  • " *.c" is smallest, containing 0.09% of code.


*.bzl2317 LOC (99%) 16 files
*.swift6 LOC (<1%) 6 files
*.h3 LOC (<1%) 3 files
*.c2 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".
  • 2 files match defined criteria (31 lines of code, 0.3% vs. main code). All matches are in *.sh files.


*.sh31 LOC (100%) 2 files
Other Code
proto
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[Ee]xamples/.*".
    • files with paths like ".*[.]txt".
  • 26 files match defined criteria (583 lines of code, 5.1% vs. main code):
    • 6 *.md files (299 lines of code)
    • 11 *.swift files (160 lines of code)
    • 2 *.proto files (50 lines of code)
    • 3 *.h files (25 lines of code)
    • 2 *.m files (25 lines of code)
    • 2 *.cc files (24 lines of code)
  • " *.md" is biggest, containing 51.29% of code.
  • " *.cc" is smallest, containing 4.12% of code.


*.md299 LOC (51%) 6 files
*.swift160 LOC (27%) 11 files
*.proto50 LOC (8%) 2 files
*.h25 LOC (4%) 3 files
*.m25 LOC (4%) 2 files
*.cc24 LOC (4%) 2 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
  • *.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


2022-02-03 05:33