apache / brpc
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
patch
in
http
spec
lua
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.

main139112 LOC (68%) 889 files
test56821 LOC (28%) 230 files
generated0 LOC (0%) 0 files
build and deployment624 LOC (<1%) 6 files
other5610 LOC (2%) 54 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
lua
spec
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 889 files match defined criteria (139,112 LOC, 100.0% vs. main code):
    • 273 *.cpp files (81,301 LOC)
    • 462 *.h files (40,920 LOC)
    • 90 *.cc files (12,824 LOC)
    • 41 *.proto files (1,676 LOC)
    • 5 *.mm files (689 LOC)
    • 2 *.hpp files (505 LOC)
    • 3 *.py files (464 LOC)
    • 5 *.cmake files (229 LOC)
    • 1 *.lua files (187 LOC)
    • 1 *.spec files (101 LOC)
    • 1 *.bzl files (78 LOC)
    • 1 *.rb files (66 LOC)
    • 3 *.in files (58 LOC)
    • 1 *.thrift files (14 LOC)
  • " *.cpp" is biggest, containing 58.44% of LOC.
  • " *.thrift" is smallest, containing 0.01% of LOC.


*.cpp81301 LOC (58%) 273 files
*.h40920 LOC (29%) 462 files
*.cc12824 LOC (9%) 90 files
*.proto1676 LOC (1%) 41 files
*.mm689 LOC (<1%) 5 files
*.hpp505 LOC (<1%) 2 files
*.py464 LOC (<1%) 3 files
*.cmake229 LOC (<1%) 5 files
*.lua187 LOC (<1%) 1 file
*.spec101 LOC (<1%) 1 file
*.bzl78 LOC (<1%) 1 file
*.rb66 LOC (<1%) 1 file
*.in58 LOC (<1%) 3 files
*.thrift14 LOC (<1%) 1 file
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
http
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 ".*_test[.].*".
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*_tests[.].*".
  • 230 files match defined criteria (56,821 LOC, 40.8% vs. main code):
    • 115 *.cpp files (37,540 LOC)
    • 89 *.cc files (18,126 LOC)
    • 16 *.proto files (965 LOC)
    • 6 *.h files (94 LOC)
    • 2 *.sh files (65 LOC)
    • 2 *.http files (31 LOC)
  • " *.cpp" is biggest, containing 66.07% of LOC.
  • " *.http" is smallest, containing 0.05% of LOC.


*.cpp37540 LOC (66%) 115 files
*.cc18126 LOC (31%) 89 files
*.proto965 LOC (1%) 16 files
*.h94 LOC (<1%) 6 files
*.sh65 LOC (<1%) 2 files
*.http31 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 (624 LOC, 0.4% vs. main code). All matches are in *.sh files.


*.sh624 LOC (100%) 6 files
Other Code
txt
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 ".*[.]txt".
    • files with paths like ".*[.]patch".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]json".
  • 54 files match defined criteria (5,610 LOC, 4.0% vs. main code):
    • 36 *.txt files (3,921 LOC)
    • 14 *.md files (1,450 LOC)
    • 4 *.json files (239 LOC)
  • " *.txt" is biggest, containing 69.89% of LOC.
  • " *.json" is smallest, containing 4.26% of LOC.


*.txt3921 LOC (69%) 36 files
*.md1450 LOC (25%) 14 files
*.json239 LOC (4%) 4 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-07 17:03