alibaba / loongcollector
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
feature
mod
in
clang-format
gitmodules
clang-tidy
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.

main210997 LOC (82%) 1,280 files
test37189 LOC (14%) 302 files
generated0 LOC (0%) 0 files
build and deployment1396 LOC (<1%) 30 files
other6117 LOC (2%) 129 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 1280 files match defined criteria (210,997 LOC, 100.0% vs. main code):
    • 417 *.cpp files (108,258 LOC)
    • 439 *.go files (71,209 LOC)
    • 333 *.h files (24,961 LOC)
    • 52 *.proto files (2,848 LOC)
    • 1 *.hpp files (1,183 LOC)
    • 19 *.yaml files (1,048 LOC)
    • 12 *.cmake files (807 LOC)
    • 2 *.c files (494 LOC)
    • 2 *.py files (120 LOC)
    • 1 *.bzl files (37 LOC)
    • 1 *.html files (23 LOC)
    • 1 *.in files (9 LOC)
  • " *.cpp" is biggest, containing 51.31% of LOC.
  • " *.in" is smallest, containing 0% of LOC.


*.cpp108258 LOC (51%) 417 files
*.go71209 LOC (33%) 439 files
*.h24961 LOC (11%) 333 files
*.proto2848 LOC (1%) 52 files
*.hpp1183 LOC (<1%) 1 file
*.yaml1048 LOC (<1%) 19 files
*.cmake807 LOC (<1%) 12 files
*.c494 LOC (<1%) 2 files
*.py120 LOC (<1%) 2 files
*.bzl37 LOC (<1%) 1 file
*.html23 LOC (<1%) 1 file
*.in9 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
feature
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 ".*/[Tt]est/.*".
    • files with paths like ".*[-]test[-].*".
    • files with paths like ".*_mock[.][a-zA-Z0-9_\-]+".
    • files with paths like ".*/mock[a-zA-Z0-9_\- ]+/.*".
    • files with paths like ".*[.]feature".
    • files with paths like ".*/e2e/.*".
  • 302 files match defined criteria (37,189 LOC, 17.6% vs. main code):
    • 205 *.go files (35,123 LOC)
    • 39 *.feature files (1,082 LOC)
    • 43 *.yaml files (662 LOC)
    • 3 *.py files (220 LOC)
    • 10 *.sh files (60 LOC)
    • 2 *.sql files (42 LOC)
  • " *.go" is biggest, containing 94.44% of LOC.
  • " *.sql" is smallest, containing 0.11% of LOC.


*.go35123 LOC (94%) 205 files
*.feature1082 LOC (2%) 39 files
*.yaml662 LOC (1%) 43 files
*.py220 LOC (<1%) 3 files
*.sh60 LOC (<1%) 10 files
*.sql42 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 ".*[.]bat".
    • files with paths like ".*[.]sh".
    • files with paths like ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/[.]gitmodules".
    • files with paths like ".*/docker[-]compose[.]yaml".
  • 30 files match defined criteria (1,396 LOC, 0.7% vs. main code):
    • 25 *.sh files (1,095 LOC)
    • 5 *.bat files (301 LOC)
  • " *.sh" is biggest, containing 78.44% of LOC.
  • " *.bat" is smallest, containing 21.56% of LOC.


*.sh1095 LOC (78%) 25 files
*.bat301 LOC (21%) 5 files
Other Code
txt
mod
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]json".
    • files with paths like ".*[.]md".
    • files with paths like ".*/README[.][a-z0-9]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*/go[.]mod".
    • files with paths like ".*[.]txt".
    • files with paths like ".*/[.]dockerignore".
  • 129 files match defined criteria (6,117 LOC, 2.9% vs. main code):
    • 65 *.md files (3,357 LOC)
    • 47 *.txt files (1,772 LOC)
    • 6 *.mod files (591 LOC)
    • 11 *.json files (397 LOC)
  • " *.md" is biggest, containing 54.88% of LOC.
  • " *.json" is smallest, containing 6.49% of LOC.


*.md3357 LOC (54%) 65 files
*.txt1772 LOC (28%) 47 files
*.mod591 LOC (9%) 6 files
*.json397 LOC (6%) 11 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-14 18:54