alibaba / havenask
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
in
txt
ll
meta
yy
cfg
pb
s
properties
patch
tpl
lua
diff
xsl
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.

main1089895 LOC (66%) 11,489 files
test414648 LOC (25%) 2,608 files
generated6525 LOC (<1%) 15 files
build and deployment108 LOC (<1%) 3 files
other135763 LOC (8%) 398 files
Main Code
All manually created or maintained source code that defines logic of the product that is run in a production environment.
proto
yy
ll
tpl
lua
in
cfg
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*".
  • 11489 files match defined criteria (1,089,895 LOC, 100.0% vs. main code):
    • 4,384 *.cpp files (591,706 LOC)
    • 6,111 *.h files (403,256 LOC)
    • 415 *.java files (40,180 LOC)
    • 216 *.py files (23,925 LOC)
    • 116 *.proto files (17,469 LOC)
    • 202 *.xml files (5,169 LOC)
    • 17 *.bzl files (5,087 LOC)
    • 4 *.yy files (765 LOC)
    • 2 *.cc files (702 LOC)
    • 5 *.ll files (619 LOC)
    • 1 *.yaml files (548 LOC)
    • 1 *.c files (145 LOC)
    • 3 *.hpp files (141 LOC)
    • 2 *.tpl files (69 LOC)
    • 2 *.lua files (53 LOC)
    • 4 *.in files (27 LOC)
    • 2 *.cfg files (21 LOC)
    • 2 *.hh files (13 LOC)
  • " *.cpp" is biggest, containing 54.29% of LOC.
  • " *.hh" is smallest, containing 0% of LOC.


*.cpp591706 LOC (54%) 4,384 files
*.h403256 LOC (36%) 6,111 files
*.java40180 LOC (3%) 415 files
*.py23925 LOC (2%) 216 files
*.proto17469 LOC (1%) 116 files
*.xml5169 LOC (<1%) 202 files
*.bzl5087 LOC (<1%) 17 files
*.yy765 LOC (<1%) 4 files
*.cc702 LOC (<1%) 2 files
*.ll619 LOC (<1%) 5 files
*.yaml548 LOC (<1%) 1 file
*.c145 LOC (<1%) 1 file
*.hpp141 LOC (<1%) 3 files
*.tpl69 LOC (<1%) 2 files
*.lua53 LOC (<1%) 2 files
*.in27 LOC (<1%) 4 files
*.cfg21 LOC (<1%) 2 files
*.hh13 LOC (<1%) 2 files
Test Code
Used only for testing of the product. Normally not deployed in a production environment.
proto
in
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*/[Tt]est/.*".
    • files with paths like ".*/test_.*".
    • files with paths like ".*/[Tt]ests/.*".
    • files with paths like ".*/test[.].*".
    • files with paths like ".*_test[.].*".
    • files with paths like ".*_mock[.][a-zA-Z0-9_\-]+".
  • 2608 files match defined criteria (414,648 LOC, 38.0% vs. main code):
    • 1,860 *.cpp files (381,370 LOC)
    • 732 *.h files (32,426 LOC)
    • 9 *.py files (711 LOC)
    • 2 *.proto files (73 LOC)
    • 5 *.in files (68 LOC)
  • " *.cpp" is biggest, containing 91.97% of LOC.
  • " *.in" is smallest, containing 0.02% of LOC.


*.cpp381370 LOC (91%) 1,860 files
*.h32426 LOC (7%) 732 files
*.py711 LOC (<1%) 9 files
*.proto73 LOC (<1%) 2 files
*.in68 LOC (<1%) 5 files
Generated Code
Automatically generated files, not manually changed after generation.
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with any line of content like "//[ ]*Generated by .*".
    • files with paths like ".*[.](py|java|h|cc|cpp|m|rb|php)" AND any line of content like ".*Generated by the protocol buffer compiler[.][ ]+DO NOT EDIT[!].*".
  • 15 files match defined criteria (6,525 LOC, 0.6% vs. main code). All matches are in *.java files.


*.java6525 LOC (100%) 15 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 ".*[.]git[a-z]+".
    • files with paths like ".*/[.]gitignore".
    • files with paths like ".*[.]sh".
  • 3 files match defined criteria (108 LOC, 0.0% vs. main code). All matches are in *.sh files.


*.sh108 LOC (100%) 3 files
Other Code
txt
properties
Explore:   circles  |  sunburst
  • The following criteria are used to filter files:
    • files with paths like ".*[.]txt".
    • files with paths like ".*[.]diff".
    • files with paths like ".*[.]patch".
    • 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 ".*[.]properties".
  • 398 files match defined criteria (135,763 LOC, 12.5% vs. main code):
    • 390 *.json files (135,510 LOC)
    • 3 *.md files (145 LOC)
    • 3 *.txt files (66 LOC)
    • 2 *.properties files (42 LOC)
  • " *.json" is biggest, containing 99.81% of LOC.
  • " *.properties" is smallest, containing 0.03% of LOC.


*.json135510 LOC (99%) 390 files
*.md145 LOC (<1%) 3 files
*.txt66 LOC (<1%) 3 files
*.properties42 LOC (<1%) 2 files
Analyzers
Info about analyzers used for source code examinations.


2025-05-14 19:03