Skip to content

CLI Reference & Modes

Krzysztofci edited this page Jun 26, 2026 · 2 revisions

Command Line Interface (CLI)

logic-cov features flexible flags to adjust report verbosity. Contrary to initial assumptions, the tool does not scan a hardcoded scripts folder; instead, it accepts dynamic paths as positional arguments.

General Syntax

python3 logic-cov.py [test_path] [src_path] [flags]
  • test_path (Default: tests) — The path to the directory containing pytest tests.
  • src_path (Default: .) — The path to the application’s source code.

Global System Installation (Optional)

For maximum convenience and to save terminal typing effort, it is recommended to copy the script into your local binary directory without the file extension and grant execution permissions:

cd ~/logic-cov/
cp logic-cov.py ~/.local/bin/logic-cov
chmod +x ~/.local/bin/logic-cov

From now on, you can run the tool just like any other system command using the logic-cov command from any directory on the system without prefixing it with python3.

In the following sections, the commands: python3 logic-cov.py [test_path] [src_path] [flags] and logic-cov [test_path] [src_path] [flags] can be used interchangeably.

Available Modes

1. Default Mode (Structure Summary)

Lists the percentage share of each layer (GUI/LOGIC/MIXED) in the files based on the length of function bodies. logic-cov This command scans the current working directory (.) along with all subdirectories for *.py files, performs the layer analysis, and formats the output into a clean table:

===============================================================================================
NAME                                     | GUI        | LOGIC      | MIXED      | UNKNOWN   
===============================================================================================
glava-gui.py                             |      54.8% |      30.4% |      14.3% |       0.6%
gui/__init__.py                          |       0.0% |       0.0% |       0.0% |       0.0%
gui/color_button.py                      |      39.0% |      40.8% |      16.4% |       3.8%
gui/colors.py                            |       0.0% |      92.5% |       0.0% |       7.5%
gui/core.py                              |       0.0% |     100.0% |       0.0% |       0.0%
gui/geometry.py                          |       0.0% |     100.0% |       0.0% |       0.0%
gui/glava.py                             |       0.0% |      98.4% |       0.0% |       1.6%
gui/instance.py                          |       0.0% |      95.6% |       0.0% |       4.4%
gui/instance_tab_bar.py                  |      74.1% |      21.2% |       1.4% |       3.3%
gui/modules/__init__.py                  |       0.0% |       0.0% |       0.0% |       0.0%
gui/modules/bars.py                      |      66.9% |      30.2% |       0.0% |       2.9%
gui/modules/base.py                      |      60.4% |      36.6% |       0.0% |       2.9%
gui/modules/circle.py                    |      74.5% |      23.8% |       0.0% |       1.8%
gui/modules/glsl_io.py                   |      14.7% |      85.3% |       0.0% |       0.0%
gui/modules/graph.py                     |      75.6% |      22.2% |       0.0% |       2.2%
gui/modules/radial.py                    |      74.7% |      17.1% |       0.0% |       8.3%
gui/modules/wave.py                      |      69.7% |      25.9% |       0.0% |       4.5%
gui/tab_advanced.py                      |      72.3% |      26.0% |       0.0% |       1.7%
gui/tab_main.py                          |      41.4% |      55.9% |       0.0% |       2.8%
gui/tab_module.py                        |      24.2% |      75.8% |       0.0% |       0.0%
gui/theme.py                             |      83.3% |      11.1% |       0.0% |       5.6%
gui/themes/__init__.py                   |       0.0% |       0.0% |       0.0% |       0.0%
gui/widgets.py                           |      25.8% |      37.1% |      35.1% |       2.1%
-----------------------------------------------------------------------------------------------
TOTAL                                    |      48.7% |      45.0% |       3.7% |       2.5%
===============================================================================================

2. Target Density Mode (-v)

Exposes test accuracy and target viability. It indicates what percentage of a file's executable statements represent actual core backend logic, alongside a precise map of target line ranges.

logic-cov -v

krzysztof@lenovo:~/bing-glava-suite/scripts$ logic-cov -v

===============================================================================================
============================ logic test-targets: platform analysis ============================
Name                                            Stmts   Logic Target%
-----------------------------------------------------------------------------------------------
glava-gui.py                                     1066     476     45%
  ↳ Target Logic Lines: 76-95, 98-101, 109-142, 148-179, 186-216, 371-375, 377-386, 475-487, 489-530, 532-583, 715-719, 721-725, 762-764, 766-793, 799-800, 892-1000, 1001-1010, 1021-1033, 1053-1110
gui/__init__.py                                     0       0      0%
gui/color_button.py                               213     122     57%
  ↳ Target Logic Lines: 30-75, 87-95, 114-134, 138-146, 160-170, 237-245, 253-269
gui/colors.py                                     173     160     92%
  ↳ Target Logic Lines: 32-56, 58-102, 104-122, 124-135, 138-164, 167-198
gui/core.py                                       117     117    100%
  ↳ Target Logic Lines: 81-87, 90-93, 96-99, 102-105, 112-121, 124-127, 134-143, 146-152, 159-168, 171-181, 188-195, 198-201, 219-228, 231-234, 237-239, 242-248, 251-260
gui/geometry.py                                   157     157    100%
  ↳ Target Logic Lines: 37-46, 49-86, 89-122, 129-171, 178-193, 196-211
gui/glava.py                                      375     369     98%
  ↳ Target Logic Lines: 26-28, 31-38, 41-53, 56-63, 66-77, 80-93, 101-103, 109-113, 115-119, 121-142, 144-145, 152-195, 198-236, 239-245, 248-276, 270-274, 283-286, 289-291, 299-317, 311-315, 320-325, 332-346, 349-368, 371-379, 382-428, 431-444, 447-454
gui/instance.py                                   113     108     96%
  ↳ Target Logic Lines: 25-32, 37-38, 41-42, 44-45, 47-48, 50-51, 54-55, 58-59, 63-66, 72-90, 138-143, 145-146, 155-170, 172-176, 178-190, 199-211, 213-220
gui/instance_tab_bar.py                           359      81     23%
  ↳ Target Logic Lines: 49-77, 263-279, 363-370, 372-376, 379-384, 399-410, 412-415
gui/modules/__init__.py                             0       0      0%
gui/modules/bars.py                               242      73     30%
  ↳ Target Logic Lines: 81-90, 256-264, 268-282, 284-295, 299-304, 306-322, 324-327
gui/modules/base.py                               445     163     37%
  ↳ Target Logic Lines: 77-86, 88-92, 156-166, 189-197, 226-234, 235-243, 257-292, 294-322, 324-332, 334-338, 342-347, 351-355, 358-362, 365-369, 372-376, 379-383
gui/modules/circle.py                             282      67     24%
  ↳ Target Logic Lines: 62-70, 73-87, 94-100, 184-186, 319-322, 324-326, 328-333, 335-345, 350-358
gui/modules/glsl_io.py                            273     233     85%
  ↳ Target Logic Lines: 16-19, 26-44, 47-71, 78-96, 99-121, 128-143, 146-156, 159-162, 165-175, 182-201, 204-224, 231-241, 244-253, 256-263, 266-276, 279-288, 324-333
gui/modules/graph.py                              180      40     22%
  ↳ Target Logic Lines: 59-71, 217-222, 224-233, 235-245
gui/modules/radial.py                             363      62     17%
  ↳ Target Logic Lines: 78-91, 94-107, 115-120, 410-413, 415-417, 419-430, 435-443
gui/modules/wave.py                               290      75     26%
  ↳ Target Logic Lines: 52-59, 62-73, 80-91, 207-209, 211-221, 333-346, 351-353, 355-366
gui/tab_advanced.py                               527     137     26%
  ↳ Target Logic Lines: 25-28, 150-162, 213-220, 372-375, 377-383, 385-393, 395-414, 416-422, 433-463, 475-477, 481-496, 502-516
gui/tab_main.py                                   648     362     56%
  ↳ Target Logic Lines: 52-60, 66-72, 74-80, 82-87, 293-299, 301-309, 311-316, 333-337, 339-373, 374-407, 409-416, 418-420, 422-429, 488-493, 495-530, 532-540, 542-558, 560-566, 568-574, 576-584, 586-591, 593-596, 598-600, 602-605, 607-615, 617-670, 676-697, 699-715, 717-720, 721-724
gui/tab_module.py                                 124      94     76%
  ↳ Target Logic Lines: 26-30, 49-64, 66-81, 83-90, 92-96, 98-131, 138-147
gui/theme.py                                       54       6     11%
  ↳ Target Logic Lines: 146-148, 188-190
gui/themes/__init__.py                              0       0      0%
gui/widgets.py                                     97      70     72%
  ↳ Target Logic Lines: 11-44, 77-84, 86-88, 89-99, 101-102, 104-108, 110-116
-----------------------------------------------------------------------------------------------
TOTAL                                            6098    2972     49%
===============================================================================================
=================================== target scanning finished ==================================

3. Deep Verbose Dump Mode (-vv)

Generates an extensive function breakdown tree for every discovered file, showing exact heuristics matching scores (gui=X logic=Y). Ideal for fine-tuning or debugging the AST analyzer rules.

logic-cov -vv

krzysztof@lenovo:~/bing-glava-suite/scripts/gui/modules$ logic-cov -vv

==================================== verbose function dump ====================================

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/bars.py
  ------------------------------------------------------------
    GUI     | gui=2   logic=0   | build_params
    GUI     | gui=3   logic=0   | collect_params
    UNKNOWN | gui=0   logic=0   | apply_params
    LOGIC   | gui=1   logic=6   | reset_shader
    UNKNOWN | gui=0   logic=0   | _init_extra
    GUI     | gui=2   logic=0   | build_left
    GUI     | gui=2   logic=0   | build_right
    GUI     | gui=2   logic=0   | _build_shape
    GUI     | gui=6   logic=0   | _build_flags
    GUI     | gui=2   logic=0   | _build_smooth
    GUI     | gui=19  logic=0   | _build_profiles
    GUI     | gui=7   logic=0   | _combo_row
    LOGIC   | gui=0   logic=1   | _validate_buf_sample
    LOGIC   | gui=0   logic=2   | _reset_shader
    LOGIC   | gui=0   logic=2   | _write_flag
    LOGIC   | gui=0   logic=2   | _update_geometry
    LOGIC   | gui=0   logic=2   | _write_bool_rc
    LOGIC   | gui=0   logic=1   | on_select

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/base.py
  ------------------------------------------------------------
    GUI     | gui=18  logic=0   | ask_string
    GUI     | gui=6   logic=0   | make_detachable_lf
    GUI     | gui=11  logic=0   | detach_section
    GUI     | gui=1   logic=0   | _close_detached
    GUI     | gui=1   logic=0   | _ok
    GUI     | gui=1   logic=0   | _cancel
    LOGIC   | gui=0   logic=2   | __init__
    LOGIC   | gui=0   logic=2   | _get_instance
    UNKNOWN | gui=0   logic=0   | _init_extra
    GUI     | gui=6   logic=0   | build
    GUI     | gui=2   logic=0   | build_left
    GUI     | gui=2   logic=0   | build_right
    GUI     | gui=2   logic=0   | _schedule_restart
    LOGIC   | gui=0   logic=1   | _debounce
    GUI     | gui=13  logic=0   | _slider_row
    GUI     | gui=13  logic=0   | _float_slider_row
    LOGIC   | gui=0   logic=1   | _apply_profile
    LOGIC   | gui=0   logic=2   | _save_profile
    LOGIC   | gui=0   logic=1   | _delete_profile
    LOGIC   | gui=0   logic=1   | _refresh_cb
    LOGIC   | gui=0   logic=1   | _expert
    LOGIC   | gui=0   logic=1   | _module_glsl
    LOGIC   | gui=0   logic=1   | _smooth_glsl
    LOGIC   | gui=0   logic=1   | _glsl
    LOGIC   | gui=0   logic=1   | _tmpl
    LOGIC   | gui=0   logic=1   | _frag
    UNKNOWN | gui=0   logic=0   | _detachable_lf
    UNKNOWN | gui=0   logic=0   | _on_detach_close
    GUI     | gui=3   logic=0   | _place_icon
    UNKNOWN | gui=0   logic=0   | on_change
    LOGIC   | gui=0   logic=1   | on_entry
    LOGIC   | gui=0   logic=1   | on_change
    LOGIC   | gui=0   logic=1   | on_entry

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/circle.py
  ------------------------------------------------------------
    GUI     | gui=2   logic=0   | build_params
    GUI     | gui=3   logic=0   | collect_params
    LOGIC   | gui=0   logic=1   | apply_params
    LOGIC   | gui=1   logic=6   | reset_shader
    LOGIC   | gui=0   logic=1   | _rotate_to_deg
    UNKNOWN | gui=0   logic=0   | _deg_to_rotate
    LOGIC   | gui=0   logic=1   | _init_extra
    GUI     | gui=2   logic=0   | build_left
    GUI     | gui=2   logic=0   | build_right
    GUI     | gui=3   logic=0   | _build_shape
    GUI     | gui=10  logic=0   | _build_rotate
    GUI     | gui=10  logic=0   | _build_position
    GUI     | gui=7   logic=0   | _build_flags
    GUI     | gui=3   logic=0   | _build_smooth
    GUI     | gui=19  logic=0   | _build_profiles
    LOGIC   | gui=0   logic=2   | _write_rotate
    LOGIC   | gui=0   logic=2   | _write_flag
    LOGIC   | gui=0   logic=1   | _debounce_int
    LOGIC   | gui=0   logic=2   | _reset_shader
    UNKNOWN | gui=0   logic=0   | on_rot
    LOGIC   | gui=0   logic=2   | on_offset

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/glsl_io.py
  ------------------------------------------------------------
    LOGIC   | gui=0   logic=1   | decimals
    LOGIC   | gui=0   logic=6   | read_defines
    LOGIC   | gui=0   logic=12  | write_defines
    LOGIC   | gui=0   logic=6   | read_flag_defines
    LOGIC   | gui=0   logic=12  | write_flag_defines
    LOGIC   | gui=0   logic=6   | read_raw
    LOGIC   | gui=0   logic=8   | write_define_int
    LOGIC   | gui=0   logic=2   | write_define_float
    LOGIC   | gui=0   logic=8   | write_define_raw
    LOGIC   | gui=0   logic=6   | read_smooth
    LOGIC   | gui=0   logic=8   | write_smooth
    LOGIC   | gui=0   logic=6   | read_int_req
    LOGIC   | gui=0   logic=8   | write_int_req
    LOGIC   | gui=0   logic=6   | read_bool_req
    LOGIC   | gui=0   logic=8   | write_bool_req
    LOGIC   | gui=0   logic=8   | write_request
    GUI     | gui=7   logic=0   | tip
    LOGIC   | gui=0   logic=6   | read_all_defines
    GUI     | gui=5   logic=0   | show
    GUI     | gui=3   logic=0   | hide

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/graph.py
  ------------------------------------------------------------
    GUI     | gui=2   logic=0   | build_params
    GUI     | gui=3   logic=0   | collect_params
    UNKNOWN | gui=0   logic=0   | apply_params
    LOGIC   | gui=1   logic=6   | reset_shader
    GUI     | gui=2   logic=0   | build_left
    GUI     | gui=2   logic=0   | build_right
    GUI     | gui=3   logic=0   | _build_shape
    GUI     | gui=8   logic=0   | _build_flags
    GUI     | gui=3   logic=0   | _build_smooth
    GUI     | gui=19  logic=0   | _build_profiles
    LOGIC   | gui=0   logic=2   | _write_flag
    LOGIC   | gui=0   logic=2   | _update_geometry_for_flip
    LOGIC   | gui=0   logic=2   | _reset_shader

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/radial.py
  ------------------------------------------------------------
    GUI     | gui=2   logic=0   | build_params
    GUI     | gui=2   logic=0   | collect_params
    LOGIC   | gui=0   logic=1   | apply_params
    LOGIC   | gui=0   logic=6   | reset_shader
    LOGIC   | gui=0   logic=1   | _rotate_to_deg
    UNKNOWN | gui=0   logic=0   | _deg_to_rotate
    LOGIC   | gui=0   logic=1   | _init_extra
    GUI     | gui=2   logic=0   | build_left
    GUI     | gui=2   logic=0   | build_right
    GUI     | gui=10  logic=0   | _build_shape
    GUI     | gui=10  logic=0   | _build_position
    GUI     | gui=7   logic=0   | _build_flags
    GUI     | gui=3   logic=0   | _build_smooth
    GUI     | gui=19  logic=0   | _build_profiles
    GUI     | gui=7   logic=0   | _int_row
    GUI     | gui=7   logic=0   | _float_row
    GUI     | gui=7   logic=0   | _smooth_row
    UNKNOWN | gui=0   logic=0   | _debounce_int
    UNKNOWN | gui=0   logic=0   | _debounce_float
    UNKNOWN | gui=0   logic=0   | _debounce_smooth
    LOGIC   | gui=0   logic=2   | _write_rotate
    LOGIC   | gui=0   logic=2   | _write_flag
    LOGIC   | gui=0   logic=2   | _reset_shader
    UNKNOWN | gui=0   logic=0   | on_rot_change
    UNKNOWN | gui=0   logic=0   | on_change
    UNKNOWN | gui=0   logic=0   | on_change
    UNKNOWN | gui=0   logic=0   | on_change
    UNKNOWN | gui=0   logic=0   | on_change

FILE: /home/krzysztof/bing-glava-suite/scripts/gui/modules/wave.py
  ------------------------------------------------------------
    GUI     | gui=2   logic=0   | build_params
    GUI     | gui=1   logic=0   | collect_params
    LOGIC   | gui=0   logic=1   | apply_params
    LOGIC   | gui=0   logic=6   | reset_shader
    LOGIC   | gui=0   logic=1   | _init_extra
    GUI     | gui=2   logic=0   | build_left
    GUI     | gui=2   logic=0   | build_right
    GUI     | gui=9   logic=0   | _build_shape
    UNKNOWN | gui=0   logic=0   | _on_wave_length
    GUI     | gui=15  logic=0   | _build_position
    UNKNOWN | gui=0   logic=0   | _on_rotate
    LOGIC   | gui=0   logic=2   | _on_offset
    LOGIC   | gui=0   logic=1   | _on_unlock_toggle
    GUI     | gui=5   logic=0   | _build_smooth
    GUI     | gui=19  logic=0   | _build_profiles
    GUI     | gui=7   logic=0   | _int_row
    GUI     | gui=7   logic=0   | _float_row
    LOGIC   | gui=0   logic=1   | _clamp_thickness
    LOGIC   | gui=0   logic=2   | _write_shape
    LOGIC   | gui=0   logic=2   | _reset_shader
    UNKNOWN | gui=0   logic=0   | on_change
    UNKNOWN | gui=0   logic=0   | on_change

===================================== end of function dump ====================================

===============================================================================================
NAME                                     | GUI        | LOGIC      | MIXED      | UNKNOWN   
===============================================================================================
__init__.py                              |      0.0% |      0.0% |      0.0% |      0.0%
bars.py                                  |     66.9% |     30.2% |      0.0% |      2.9%
base.py                                  |     60.4% |     36.6% |      0.0% |      2.9%
circle.py                                |     74.5% |     23.8% |      0.0% |      1.8%
glsl_io.py                               |     14.7% |     85.3% |      0.0% |      0.0%
graph.py                                 |     75.6% |     22.2% |      0.0% |      2.2%
radial.py                                |     74.7% |     17.1% |      0.0% |      8.3%
wave.py                                  |     69.7% |     25.9% |      0.0% |      4.5%
-----------------------------------------------------------------------------------------------
TOTAL                                    |     62.2% |     34.4% |      0.0% |      3.5%
=============================================================================================== 

4. Advanced Inclusion (--include-venv)

By default, the scanner strictly ignores environment and cache artifacts (.venv, site-packages, pycache). Specifying this flag completely disables this exclusion filter.

logic-cov --include-venv

Clone this wiki locally