Views
No views yet
code_block was scanned individually and joined back to the source snippet as an
audit trail. The maintainability_rating (A–E) is the headline label; supporting raw
metrics (code smells, complexity, bugs, technical debt) are kept for transparency.| Records | 2,599,355 |
Rated (non-empty maintainability_rating) | 2,596,565 (99.89%) |
| Format | single comma-delimited CSV, one header |
| File | code4ml_sonarqube_rated.csv (~986 MB) |
| Language | Python |
| column | type | description |
|---|---|---|
| (unnamed index) | int | row index inherited from source shards |
kernel_id | int | Kaggle kernel/notebook id |
code_block_id | int | id of the code block within the kernel |
code_block | string | the Python source snippet (may span multiple lines) |
sqale_rating | float | raw SQALE rating (1.0 = A … 5.0 = E) |
maintainability_rating | string | maintainability grade A–E (headline label) |
code_smells | int | number of code smells |
complexity | int | cyclomatic complexity |
cognitive_complexity | int | cognitive complexity |
bugs | int | number of bugs detected |
sqale_index | int | technical-debt index (minutes) |
ncloc | int | non-comment lines of code |
1from datasets import load_dataset
2
3ds = load_dataset("<your-username>/code4ml-sonarqube-maintainability", split="train")
4print(ds[0]["code_block"], ds[0]["maintainability_rating"])good = ds.filter(lambda r: r["maintainability_rating"] in {"A", "B", "C"})code_blocks.csv into 12 balanced shards (Rust CSV splitter).sonar-scanner.id;maintainability_rating ratings back onto each shard
(add-rating, LEFT JOIN on code_block_id).code_block snippets are Kaggle notebook cells, each published
under the Apache-2.0 license (see per-kernel links in Code4ML's kernels_meta.csv).
Cells were split and stripped of redundant comments/markdown; PEP8 fixes may have been
applied. No code-affecting changes were made. See NOTICE.txt.LICENSE.code_block snippets are Kaggle notebook code, each under the
Apache-2.0 license; that attribution is preserved in NOTICE.txt. Redistributing the
Apache-2.0 code within this CC-BY-4.0 dataset is permitted as long as the NOTICE is kept.