app: clean up dead code, leftovers and naming issues #63

Open
opened 2026-10-06 13:55:34 +00:00 by ffrauenberger · 1 comment
Owner

Severity: improvement (low)

Where

  • app/analysis/detection_model.py:87
  • app/components/interactiveGraph/frontend/src/InteractiveGraph.tsx:44
  • app/config.py:22-23
  • app/mining_algorithms/alpha_mining.py:224-234, :262-269
  • app/mining_algorithms/base_mining.py:652
  • app/mining_algorithms/fuzzy_mining.py:70, :646-651, :877-881
  • app/mining_algorithms/inductive_mining.py:87-89
  • app/transformations/dataframe_styler.py:49
  • app/ui/column_selection_ui/base_column_selection_view.py:99
  • app/ui/fuzzy_miner_ui/fuzzy_miner_view.py:8
  • app/ui/home_ui/home_view.py:393-410
  • templates/

Problem

Location Issue
app/mining_algorithms/inductive_mining.py:87-89 events_to_remove is computed (O(n)) and only logged, never used.
app/mining_algorithms/alpha_mining.py:224-234 create_safe_ingoing_edge / create_safe_outgoing_edge / create_safe_node are unused and call add_empty_circle, which does not exist on PetriNetGraph.
app/mining_algorithms/alpha_mining.py:262-269 __is_set_in_parallel is unused.
app/mining_algorithms/fuzzy_mining.py:646-651 __get_clustered_node is unused.
app/mining_algorithms/fuzzy_mining.py:70, :144, :209-210, :720, :809, :819, :825 Commented-out code and print leftovers; comments like # why is this done? and "asked ChatGpt how to do this" in docstrings.
app/mining_algorithms/fuzzy_mining.py:877-881 A local variable dict shadows the builtin; sum is shadowed at line 709. Significance values are stored as strings (format(..., ".2f")) and parsed back later.
app/transformations/dataframe_styler.py:49 Typo in public method name: stlye_df.
app/config.py:22-23 and many usages cluster_seperator (typo).
app/ui/fuzzy_miner_ui/fuzzy_miner_view.py:8 Docstring says "View for the Genetic Miner".
app/ui/home_ui/home_view.py:393-410 _default_index is documented as returning None and taking "a list of preferred values", but returns 0 and takes a single value.
app/ui/column_selection_ui/base_column_selection_view.py:99 algorithm = st.selectbox(...) is assigned and never used.
app/analysis/detection_model.py:87 f"Delimiter detection failed" is an f-string without placeholders; the exception e is discarded.
app/components/interactiveGraph/frontend/src/InteractiveGraph.tsx:44 console.log(node_id) left in production code.
app/mining_algorithms/base_mining.py:652 Docstring says the SPM default is 0.15; the code uses 0.10.
templates/ The UI/algorithm templates are not covered by tests or CI and can drift from the real base classes.

Fix

Remove the dead code and leftovers, fix the typos and wrong docstrings, and add the templates to CI (at least an import/instantiation check).


from issues/CQ-001-dead-code-and-leftovers.md (code analysis of commit 6bcc646, 2026-10-03)

**Severity:** improvement (low) ## Where - `app/analysis/detection_model.py:87` - `app/components/interactiveGraph/frontend/src/InteractiveGraph.tsx:44` - `app/config.py:22-23` - `app/mining_algorithms/alpha_mining.py:224-234`, `:262-269` - `app/mining_algorithms/base_mining.py:652` - `app/mining_algorithms/fuzzy_mining.py:70`, `:646-651`, `:877-881` - `app/mining_algorithms/inductive_mining.py:87-89` - `app/transformations/dataframe_styler.py:49` - `app/ui/column_selection_ui/base_column_selection_view.py:99` - `app/ui/fuzzy_miner_ui/fuzzy_miner_view.py:8` - `app/ui/home_ui/home_view.py:393-410` - `templates/` ## Problem | Location | Issue | |---|---| | `app/mining_algorithms/inductive_mining.py:87-89` | `events_to_remove` is computed (O(n)) and only logged, never used. | | `app/mining_algorithms/alpha_mining.py:224-234` | `create_safe_ingoing_edge` / `create_safe_outgoing_edge` / `create_safe_node` are unused and call `add_empty_circle`, which does not exist on `PetriNetGraph`. | | `app/mining_algorithms/alpha_mining.py:262-269` | `__is_set_in_parallel` is unused. | | `app/mining_algorithms/fuzzy_mining.py:646-651` | `__get_clustered_node` is unused. | | `app/mining_algorithms/fuzzy_mining.py:70`, `:144`, `:209-210`, `:720`, `:809`, `:819`, `:825` | Commented-out code and `print` leftovers; comments like `# why is this done?` and *"asked ChatGpt how to do this"* in docstrings. | | `app/mining_algorithms/fuzzy_mining.py:877-881` | A local variable `dict` shadows the builtin; `sum` is shadowed at line 709. Significance values are stored as **strings** (`format(..., ".2f")`) and parsed back later. | | `app/transformations/dataframe_styler.py:49` | Typo in public method name: `stlye_df`. | | `app/config.py:22-23` and many usages | `cluster_seperator` (typo). | | `app/ui/fuzzy_miner_ui/fuzzy_miner_view.py:8` | Docstring says "View for the **Genetic** Miner". | | `app/ui/home_ui/home_view.py:393-410` | `_default_index` is documented as returning `None` and taking "a list of preferred values", but returns `0` and takes a single value. | | `app/ui/column_selection_ui/base_column_selection_view.py:99` | `algorithm = st.selectbox(...)` is assigned and never used. | | `app/analysis/detection_model.py:87` | `f"Delimiter detection failed"` is an f-string without placeholders; the exception `e` is discarded. | | `app/components/interactiveGraph/frontend/src/InteractiveGraph.tsx:44` | `console.log(node_id)` left in production code. | | `app/mining_algorithms/base_mining.py:652` | Docstring says the SPM default is 0.15; the code uses 0.10. | | `templates/` | The UI/algorithm templates are not covered by tests or CI and can drift from the real base classes. | ## Fix Remove the dead code and leftovers, fix the typos and wrong docstrings, and add the templates to CI (at least an import/instantiation check). --- from `issues/CQ-001-dead-code-and-leftovers.md` (code analysis of commit 6bcc646, 2026-10-03)
Author
Owner

Reviewed by Codex (GPT-6) against origin/main 6bcc646eb464.

Review: partially correct.

The cleanup findings are largely supported. Correct the Alpha helper row: only create_safe_node calls the nonexistent PetriNetGraph.add_empty_circle; create_safe_ingoing_edge and create_safe_outgoing_edge call create_edge instead (lines 224–234). All three are currently unused in the application/test/template searches. Also, _default_index documents an int | None return, with None for the no-match case; the mismatch is specifically that the no-match implementation returns 0, not that the entire function is documented as always returning None.

Code references: app/mining_algorithms/alpha_mining.py:224, app/ui/home_ui/home_view.py:393.

Reviewed by **Codex (GPT-6)** against origin/main [`6bcc646eb464`](https://code.swisdata.eu/ffrauenberger/ProcessIntel/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4). **Review: partially correct.** The cleanup findings are largely supported. Correct the Alpha helper row: only **`create_safe_node`** calls the nonexistent `PetriNetGraph.add_empty_circle`; `create_safe_ingoing_edge` and `create_safe_outgoing_edge` call `create_edge` instead (lines 224–234). All three are currently unused in the application/test/template searches. Also, `_default_index` documents an `int | None` return, with `None` for the no-match case; the mismatch is specifically that the no-match implementation returns 0, not that the entire function is documented as always returning None. Code references: [app/mining_algorithms/alpha_mining.py:224](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/mining_algorithms/alpha_mining.py#L224), [app/ui/home_ui/home_view.py:393](https://code.swisdata.eu/ffrauenberger/ProcessIntel/src/commit/6bcc646eb464e0dd897228b5e49867f65d7255c4/app/ui/home_ui/home_view.py#L393).
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ffrauenberger/ProcessIntel#63
No description provided.