AI Slop Code RIsk Monitor

canonical/microk8s

MicroK8s is a small, fast, single-package Kubernetes for datacenters and the edge.

9.3 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for canonical/microk8s, a Python project with 9,383 GitHub stars. SynthScan examined 32,265 lines of code across 179 source files, recording 199 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 9.3 (Moderate pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

9.3
Adjusted Signal
9.3
Raw Pattern Score
100%
Time Factor
2026-10-11
Last Push
9.4K
Stars
Python
Language
32.3K
Lines of Code
179
Files
199
Pattern Hits
2026-10-12
Scan Date
0.09
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 25.6/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 156 finding(s).

Hallucinated Dependency & Supply Chain Risk 0.6/100 · LOW

Are imports declared and package/API names verified? 4 finding(s).

Agent Over-Engineering Ratio 24.8/100 · LOW

Are wrappers, guards, and repeated structures necessary? 120 finding(s).

PR Review Velocity Impact 38.2/100 · MEDIUM

Which changes need focused human review? 199 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 0HIGH 16MEDIUM 16LOW 167

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 199 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.

Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Hyper-Verbose Identifiers80 hits · 78 pts
SeverityFileLineSnippetContext
LOWtests/test-cluster-agent.py9 def test_cluster_agent_health(self):CODE
LOWtests/test-simple.py26 def test_calico_cni_pods_running(self):CODE
LOWtests/utils.py157def wait_for_namespace_termination(namespace, timeout_insec=360):CODE
LOWtests/test-cluster.py134 def _load_launch_configuration_lxc(self):CODE
LOWtests/test-cluster.py150 def _transfer_install_local_snap_lxc(self, channel_or_snap):CODE
LOWtests/test-cluster.py198 def _load_launch_configuration_multipass(self):CODE
LOWtests/test-cluster.py216 def _transfer_install_local_snap_multipass(self, channel_or_snap):CODE
LOWtests/test-cluster.py378 def test_calico_interfaces_removed_on_snap_remove(self):CODE
LOWtests/test-cluster.py599 def test_no_cert_reissue_in_nodes(self):CODE
LOWtests/test-cluster.py660 def setup_old_versioned_cluster(self):CODE
LOWtests/unit/test_refresh_certs.py25 def test_reproduce_all_root_ca_certs(self, mock_check_call, mock_subproc_popen, mock_get_arg):CODE
LOWtests/unit/test_refresh_certs.py50 def test_reproduce_front_proxy_client_cert(self, mock_check_call, mock_restart):CODE
LOWtests/unit/test_refresh_certs.py68 def test_reproduce_server_cert(self, mock_check_call, mock_restart):CODE
LOWtests/unit/test_refresh_certs.py133def test_command_help_arguments():CODE
LOW⚡tests/unit/test_enable.py6def test_command_help_arguments():CODE
LOW⚡tests/unit/test_enable.py14def test_command_errors_if_no_arguments():CODE
LOW⚡tests/unit/test_enable.py22def test_command_shows_addon_help_message(xable_mock):CODE
LOW⚡tests/unit/test_disable.py6def test_command_help_arguments():CODE
LOW⚡tests/unit/test_disable.py14def test_command_errors_if_no_arguments():CODE
LOW⚡tests/unit/test_disable.py22def test_command_shows_addon_help_message(xable_mock):CODE
LOWtests/unit/test_addons.py64def test_get_available_addons(snap_common_mock, listdir_mock, strict_mock, confinement, result):STRING
LOW⚡tests/unit/test_addons.py135def test_validate_addons_file(load_addons_mock):STRING
LOW⚡tests/unit/test_addons.py140def test_validate_addons_file_raises_if_invalid_format(load_addons_mock):STRING
LOW⚡tests/unit/test_addons.py146def test_load_addons_raises_on_file_not_found():STRING
LOW⚡tests/unit/test_addons.py153def test_load_addons_raises_on_invalid_yaml_contents(repo_dir):STRING
LOW⚡tests/unit/test_addons.py168def test_validate_addons_repo(repo_dir):STRING
LOW⚡tests/unit/test_addons.py172def test_validate_addons_repo_raises_on_missing_enable_hook(addon_missing_enable_hook):STRING
LOW⚡tests/unit/test_addons.py178def test_validate_addons_repo_raises_on_missing_disable_hook(addon_missing_disable_hook):STRING
LOW⚡tests/unit/test_addons.py184def test_validate_addons_repo_raises_on_enable_not_executable(enable_not_executable):STRING
LOW⚡tests/unit/test_addons.py190def test_validate_addons_repo_raises_on_disable_not_executable(disable_not_executable):STRING
LOWtests/unit/test_addons.py201def test_add_removes_repo_on_validation_error(STRING
LOWtests/unit/test_addons.py258def addon_missing_enable_hook(repo_dir):STRING
LOWtests/unit/test_addons.py265def addon_missing_disable_hook(repo_dir):STRING
LOWtests/unit/test_addons.py308def test_update_rollbacks_repo_on_validation_error(STRING
LOWtests/unit/test_reset.py5def test_command_help_arguments():CODE
LOWtests/unit/test_upgrade_calico_cni.py45 def test_get_autodetect_method(self):CODE
LOWtests/unit/cluster/test_join.py10def test_command_help_arguments():CODE
LOWtests/unit/cluster/test_join.py18def test_command_errors_if_no_arguments():CODE
LOWtests/unit/cluster/test_join.py30def test_join_dqlite_master_node(CODE
LOWtests/unit/cluster/test_leave.py5def test_command_help_arguments():CODE
LOWscripts/kill-host-pods.py19def post_filter_has_known_containers(pod, containers: list) -> bool:CODE
LOWscripts/kill-host-pods.py35def post_filter_has_snap_data_mounts(pod) -> bool:CODE
LOWscripts/find-resolv-conf.py18def safe_is_non_loopback_address(address: str):CODE
LOWscripts/find-resolv-conf.py39def find_resolv_conf_with_non_loopback_address(resolv_confs: list):CODE
LOWscripts/wrappers/refresh_certs.py116def reproduce_all_root_ca_certs():CODE
LOWscripts/wrappers/refresh_certs.py137def reproduce_front_proxy_client_cert():STRING
LOWscripts/wrappers/reset.py179def remove_non_namespaced_resources():CODE
LOWscripts/wrappers/join.py331def update_cert_auth_kubeproxy(token, master_ip, master_port):CODE
LOWscripts/wrappers/join.py468def update_kubelet_hostname_override(args_string):CODE
LOWscripts/wrappers/join.py719def rebuild_token_based_auth_configs(info):CODE
LOWscripts/wrappers/distributed_op.py34def get_cluster_agent_endpoints(include_self=False):CODE
LOWscripts/wrappers/leave.py33def reset_current_dqlite_worker_installation():CODE
LOWscripts/wrappers/leave.py85def reset_current_etcd_installation():CODE
LOWscripts/wrappers/leave.py123def reset_current_dqlite_installation():CODE
LOWscripts/wrappers/leave.py238def is_leader_without_successor():CODE
LOWscripts/wrappers/common/utils.py334def is_service_expected_to_start(service):CODE
LOWscripts/wrappers/common/utils.py345def set_service_expected_to_start(service, start=True):CODE
LOWscripts/wrappers/common/cluster/utils.py72def remove_expired_token_from_file(file):CODE
LOWscripts/wrappers/common/cluster/utils.py175def is_low_memory_guard_enabled():CODE
LOWscripts/wrappers/common/cluster/utils.py237def get_control_plane_nodes_internal_ips():CODE
20 more matches not shown…
Empty Error Handlers15 hits · 75 pts
SeverityFileLineSnippetContext
HIGHtests/validators.py147except requests.RequestException:CODE
HIGHtests/validators.py167except subprocess.CalledProcessError:CODE
HIGHscripts/kill-host-pods.py53except OSError:CODE
HIGHscripts/run-lifecycle-hooks.py24except (subprocess.CalledProcessError, OSError):CODE
HIGHscripts/find-resolv-conf.py53except (OSError, ValueError):CODE
HIGHscripts/wrappers/refresh_certs.py71except subprocess.CalledProcessError:CODE
HIGHscripts/wrappers/addons.py325except (subprocess.CalledProcessError, TypeError, ValueError):CODE
HIGHscripts/wrappers/join.py126except ValueError:CODE
HIGHscripts/wrappers/join.py602except OSError:CODE
HIGHscripts/wrappers/join.py609except ValueError:CODE
HIGHscripts/wrappers/distributed_op.py85except OSError:CODE
HIGHscripts/wrappers/common/utils.py485except OSError:CODE
HIGHscripts/wrappers/common/cluster/utils.py67except LookupError:CODE
HIGHscripts/wrappers/common/cluster/utils.py275except socket.error:CODE
HIGHscripts/calico/upgrade.py177except OSError:CODE
Deep Nesting37 hits · 37 pts
SeverityFileLineSnippetContext
LOWtests/utils.py93CODE
LOWtests/test-cluster.py83CODE
LOWtests/test-cluster.py228CODE
LOWtests/test-cluster.py289CODE
LOWtests/test-cluster.py378CODE
LOWtests/test-cluster.py660CODE
LOWtests/unit/test_refresh_certs.py86CODE
LOWscripts/wrappers/refresh_certs.py172CODE
LOWscripts/wrappers/addons.py301CODE
LOWscripts/wrappers/join.py478CODE
LOWscripts/wrappers/join.py531CODE
LOWscripts/wrappers/upgrade.py59CODE
LOWscripts/wrappers/upgrade.py124CODE
LOWscripts/wrappers/distributed_op.py34CODE
LOWscripts/wrappers/remove_node.py26CODE
LOWscripts/wrappers/remove_node.py121CODE
LOWscripts/wrappers/remove_node.py197CODE
LOWscripts/wrappers/status.py36CODE
LOWscripts/wrappers/leave.py238CODE
LOWscripts/wrappers/common/utils.py96CODE
LOWscripts/wrappers/common/utils.py141CODE
LOWscripts/wrappers/common/utils.py264CODE
LOWscripts/wrappers/common/utils.py287CODE
LOWscripts/wrappers/common/utils.py417CODE
LOWscripts/wrappers/common/utils.py561CODE
LOWscripts/wrappers/common/cluster/utils.py72CODE
LOWscripts/wrappers/common/cluster/utils.py92CODE
LOWscripts/wrappers/common/cluster/utils.py205CODE
LOWscripts/wrappers/common/cluster/utils.py225CODE
LOWscripts/wrappers/common/cluster/utils.py326CODE
LOWscripts/wrappers/common/cluster/utils.py476CODE
LOWscripts/calico/upgrade.py8CODE
LOWscripts/calico/upgrade.py35CODE
LOWscripts/calico/upgrade.py88CODE
LOWinstaller/cli/microk8s.py30CODE
LOWinstaller/cli/microk8s.py242CODE
LOWinstaller/vm_providers/repo/snaps.py102CODE
Self-Referential Comments10 hits · 36 pts
SeverityFileLineSnippetContext
MEDIUMtests/test-simple.py96 # Define the services to check for control plane and worker nodesCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh122 # Create the file if doesn't existCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh136 # Create the file if doesn't existCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh647 # Create a kubeconfig file with x509 authCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh923 # Create the basic tokensCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh925 # Create the client kubeconfigCOMMENT
MEDIUM⚡microk8s-resources/actions/common/utils.sh939 # Create the known tokensCOMMENT
MEDIUM⚡microk8s-resources/actions/common/utils.sh945 # Create the client kubeconfig for the controllerCOMMENT
MEDIUM⚡microk8s-resources/actions/common/utils.sh952 # Create the client kubeconfig for the schedulerCOMMENT
MEDIUM⚡microk8s-resources/actions/common/utils.sh959 # Create the proxy and kubelet kubeconfigCOMMENT
Excessive Try-Catch Wrapping15 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtests/test-cluster.py652 print("Error occurred during the request:", str(e))CODE
LOWscripts/wrappers/addons.py337 except Exception as e:CODE
MEDIUMscripts/wrappers/join.py866 print("Error: Unknown API auth mode '{api_authn_mode}' received from control plane node.")CODE
LOWscripts/wrappers/upgrade.py117 except Exception as e:CODE
MEDIUMscripts/wrappers/upgrade.py118 print("Error in upgrading. Error: {}".format(e))CODE
MEDIUMscripts/wrappers/upgrade.py147 print("Error in gathering cluster node information. Upgrade aborted.")CODE
LOWscripts/wrappers/remove_node.py191 except Exception as err:CODE
LOWscripts/wrappers/leave.py333 except Exception as err:CODE
LOWscripts/wrappers/common/utils.py87 except Exception:CODE
LOWscripts/wrappers/common/utils.py281 except Exception:CODE
LOWscripts/wrappers/common/utils.py308 except Exception:CODE
MEDIUMscripts/wrappers/common/utils.py39def snap() -> Path:CODE
LOWinstaller/cli/microk8s.py67 except Exception as e:CODE
MEDIUMinstaller/cli/microk8s.py30def cli(ctx, help):CODE
LOWinstaller/vm_providers/_multipass/_multipass.py73 except Exception:CODE
Over-Commented Block17 hits · 17 pts
SeverityFileLineSnippetContext
LOW…ade-scripts/000-switch-to-calico/resources/calico.yaml6201 name: cni-net-dirCOMMENT
LOW…ade-scripts/000-switch-to-calico/resources/calico.yaml6221 # mountPropagation: BidirectionalCOMMENT
LOWmicrok8s-resources/actions/common/utils.sh481 # Example: enable linkerd:proxy-auto-inject=on;other-args=xyzCOMMENT
LOWmicrok8s-resources/actions/common/utils.sh1141 # generate csrCOMMENT
LOWinstaller/microk8s.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/cli/echo.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/common/file_utils.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/factory.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/errors.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/_base_provider.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/_multipass/_multipass_command.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/_multipass/__init__.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/_multipass/_multipass.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/_multipass/_instance_info.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/_multipass/_windows.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/repo/snaps.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
LOWinstaller/vm_providers/repo/errors.py1# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*-COMMENT
Redundant / Tautological Comments6 hits · 9 pts
SeverityFileLineSnippetContext
LOWtests/test-simple.py21 # Check if the node status is "Ready"COMMENT
LOWtests/test-simple.py39 # Check if the pod is related to Calico CNI and not in the "Running" stateCOMMENT
LOWtests/test-simple.py127 # Check if the line contains a running serviceCOMMENT
LOWtests/test-simple.py131 # Check if the running service is in the control plane services listCOMMENT
LOWscripts/inspect.sh293 # Check if appropriate cgroup libraries for Fedora are installedCOMMENT
LOWscripts/inspect.sh313 # Check if snapctl is freshCOMMENT
Modern Structural Boilerplate9 hits · 9 pts
SeverityFileLineSnippetContext
LOWinstaller/cli/microk8s.py18logger = logging.getLogger(__name__)CODE
LOWinstaller/common/file_utils.py27logger = logging.getLogger(__name__)CODE
LOWinstaller/common/auxiliary.py14logger = logging.getLogger(__name__)CODE
LOWinstaller/vm_providers/_base_provider.py30logger = logging.getLogger(__name__)CODE
LOWinstaller/vm_providers/_base_provider.py158 def _setup_microk8s(self, specs: Dict) -> None:CODE
LOWinstaller/vm_providers/_multipass/_multipass_command.py29logger = logging.getLogger(__name__)CODE
LOWinstaller/vm_providers/_multipass/_multipass.py27logger = logging.getLogger(__name__)CODE
LOWinstaller/vm_providers/_multipass/_windows.py38logger = logging.getLogger(__name__)CODE
LOWinstaller/vm_providers/repo/snaps.py37logger = logging.getLogger(__name__)CODE
AI Response Leakage1 hit · 8 pts
SeverityFileLineSnippetContext
HIGH…crok8s-resources/default-args/containerd-template.toml50 # In this example, 'runc' is the RuntimeHandler string to match.COMMENT
Example Usage Blocks4 hits · 6 pts
SeverityFileLineSnippetContext
LOWmicrok8s-resources/actions/common/utils.sh878# Usage:COMMENT
LOWmicrok8s-resources/actions/common/utils.sh1104 # Example usage:COMMENT
LOWmicrok8s-resources/actions/common/utils.sh1131 # Example usage:COMMENT
LOWmicrok8s-resources/actions/common/utils.sh1154 # Example usage:COMMENT
Unused Imports4 hits · 4 pts
SeverityFileLineSnippetContext
LOWinstaller/vm_providers/factory.py23CODE
LOWinstaller/vm_providers/factory.py24CODE
LOWinstaller/vm_providers/_multipass/__init__.py17CODE
LOWinstaller/vm_providers/_multipass/__init__.py18CODE
AI Structural Patterns1 hit · 1 pts
SeverityFileLineSnippetContext
LOWinstaller/cli/echo.py92CODE