elastic / harp
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
txt
hcl
rego
mod
gitattributes
zone
editorconfig
nix
pub
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.

main23553 LOC (45%) 389 files
test17779 LOC (34%) 153 files
generated4298 LOC (8%) 10 files
build and deployment29 LOC (<1%) 1 file
other5604 LOC (10%) 56 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
nix
pub
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 389 files match defined criteria (23,553 LOC, 100.0% vs. main code):
    • 379 *.go files (22,761 LOC)
    • 8 *.proto files (763 LOC)
    • 1 *.nix files (25 LOC)
    • 1 *.pub files (4 LOC)
  • " *.go" is biggest, containing 96.64% of LOC.
  • " *.pub" is smallest, containing 0.02% of LOC.


*.go22761 LOC (96%) 379 files
*.proto763 LOC (3%) 8 files
*.nix25 LOC (<1%) 1 file
*.pub4 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
rego
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_mock[.][a-zA-Z0-9_\-]+".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*/[Tt]est/.*".
  • 153 files match defined criteria (17,779 LOC, 75.5% vs. main code):
    • 124 *.go files (17,133 LOC)
    • 26 *.yaml files (627 LOC)
    • 3 *.rego files (19 LOC)
  • " *.go" is biggest, containing 96.37% of LOC.
  • " *.rego" is smallest, containing 0.11% of LOC.


*.go17133 LOC (96%) 124 files
*.yaml627 LOC (3%) 26 files
*.rego19 LOC (<1%) 3 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 ".*/gen/.*[.]go".
  • 10 files match defined criteria (4,298 LOC, 18.2% vs. main code). All matches are in *.go files.


*.go4298 LOC (100%) 10 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".
    • files with paths like ".*/[.]gitattributes".
  • 1 file matches defined criteria (29 LOC, 0.1% vs. main code). All matches are in *.sh files.


*.sh29 LOC (100%) 1 file
Other Code
mod
hcl
rego
zone
txt
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]editorconfig".
    • files with paths like ".*[.]md".
    • files with paths like ".*[.]json".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]dockerignore".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*/[Ss]amples/.*".
  • 56 files match defined criteria (5,604 LOC, 23.8% vs. main code):
    • 20 *.md files (3,374 LOC)
    • 10 *.json files (1,079 LOC)
    • 18 *.yaml files (561 LOC)
    • 3 *.mod files (497 LOC)
    • 1 *.hcl files (31 LOC)
    • 1 *.go files (27 LOC)
    • 1 *.rego files (26 LOC)
    • 1 *.zone files (8 LOC)
    • 1 *.txt files (1 LOC)
  • " *.md" is biggest, containing 60.21% of LOC.
  • " *.txt" is smallest, containing 0.02% of LOC.


*.md3374 LOC (60%) 20 files
*.json1079 LOC (19%) 10 files
*.yaml561 LOC (10%) 18 files
*.mod497 LOC (8%) 3 files
*.hcl31 LOC (<1%) 1 file
*.go27 LOC (<1%) 1 file
*.rego26 LOC (<1%) 1 file
*.zone8 LOC (<1%) 1 file
*.txt1 LOC (<1%) 1 file
Analyzers
Info about analyzers used for source code examinations.


2025-05-13 19:53