PRIME-Py: Python Repository Inspection and Metric Extraction Dataset
收藏资源简介:
PRIME-Py is a large-scale labeled dataset of Python source code annotated with structural Poor Design Symptoms (PDS), supporting empirical research on code smell and anti-pattern detection. The dataset is published at two levels of granularity. The function level comprises 1,997,535 Python functions extracted from 2,797 open-source GitHub repositories, labeled with five structural sub-types: Long Method, High Cyclomatic Complexity, Long Parameter List, Spaghetti Code, and High Fan-Out. The class level comprises 253,412 classes derived from the function-level corpus by aggregation, labeled with two class-level symptoms: God Class and Large Class. The class level is derived from the function level rather than collected independently. Function rows are grouped into class units using boundaries obtained from the Python abstract syntax tree, and aggregated metrics are computed over each class's methods. Both levels are deposited together so that the provenance chain from function rows to class units remains inspectable. Detection thresholds are derived from the training corpus distribution rather than imported from published values. The Large Class threshold corresponds to the 75th percentile of the class NLOC distribution. The percentile derivation principle is intended to transfer across corpora; the resulting numerical value is corpus-specific and should be recomputed for any new corpus. Splits are performed at the project level with an 80/10/10 ratio, so that no project contributes rows to more than one partition. Class-level splits inherit these boundaries by construction. The deposit includes the labeled parquet files for both levels, the column schema, benchmark validation results, and the human annotation records supporting both studies. The class-level gold standard comprises 150 classes drawn under stratified sampling, labeled independently by two annotators with adjudication of disagreements. Detection and evaluation scripts are available at https://github.com/rehaidib/PRIME-Py. Changes in version 2.0 Added the class-level corpus (train, validation, and test splits) with God Class and Large Class labels Added the class-level gold standard: two independent annotator workbooks and the adjudication record Class boundaries are derived from the abstract syntax tree rather than from the minimum function start line, correcting boundary errors on decorated and nested method definitions God Class labels are recomputed from source rather than propagated from upstream label columns Extended the column schema to document class-level fields Version 1.0.0 remains available and unchanged at its own DOI.



