Repository Analysis

canonical/microk8s

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

7.0 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of canonical/microk8s, a Python project with 9,347 GitHub stars. SynthScan v2.0 examined 32,266 lines of code across 180 source files, recording 184 pattern matches distributed across 11 syntactic categories. The overall adjusted score of 7.0 places this repository in the Low AI signal band.

The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).

7.0
Adjusted Score
7.0
Raw Score
100%
Time Factor
2026-07-31
Last Push
9.3K
Stars
Python
Language
32.3K
Lines of Code
180
Files
184
Pattern Hits
2026-08-02
Scan Date
0.01
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

Severity Breakdown

Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.

CRITICAL 0HIGH 1MEDIUM 16LOW 167

Directory Score Breakdown

This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.

Pattern Findings

The scanner identified 184 distinct pattern matches across 11 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.

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
LOWtests/unit/test_enable.py6def test_command_help_arguments():CODE
LOWtests/unit/test_enable.py14def test_command_errors_if_no_arguments():CODE
LOWtests/unit/test_enable.py22def test_command_shows_addon_help_message(xable_mock):CODE
LOWtests/unit/test_disable.py6def test_command_help_arguments():CODE
LOWtests/unit/test_disable.py14def test_command_errors_if_no_arguments():CODE
LOWtests/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
LOWtests/unit/test_addons.py135def test_validate_addons_file(load_addons_mock):STRING
LOWtests/unit/test_addons.py140def test_validate_addons_file_raises_if_invalid_format(load_addons_mock):STRING
LOWtests/unit/test_addons.py146def test_load_addons_raises_on_file_not_found():STRING
LOWtests/unit/test_addons.py153def test_load_addons_raises_on_invalid_yaml_contents(repo_dir):STRING
LOWtests/unit/test_addons.py168def test_validate_addons_repo(repo_dir):STRING
LOWtests/unit/test_addons.py172def test_validate_addons_repo_raises_on_missing_enable_hook(addon_missing_enable_hook):STRING
LOWtests/unit/test_addons.py178def test_validate_addons_repo_raises_on_missing_disable_hook(addon_missing_disable_hook):STRING
LOWtests/unit/test_addons.py184def test_validate_addons_repo_raises_on_enable_not_executable(enable_not_executable):STRING
LOWtests/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…
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
MEDIUMmicrok8s-resources/actions/common/utils.sh939 # Create the known tokensCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh945 # Create the client kubeconfig for the controllerCOMMENT
MEDIUMmicrok8s-resources/actions/common/utils.sh952 # Create the client kubeconfig for the schedulerCOMMENT
MEDIUMmicrok8s-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