code-maat-python 0.1.1__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/PKG-INFO +8 -8
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/README.md +7 -7
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/__init__.py +2 -2
- code_maat_python-0.2.0/code_maat_python/__main__.py +5 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/__init__.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/age.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/authors.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/churn.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/communication.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/coupling.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/effort.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/entities.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/revisions.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/soc.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/analyses/summary.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/cli.py +62 -61
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/parser.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/pipeline.py +1 -1
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/pyproject.toml +2 -2
- code_maat_python-0.1.1/code_maat_python/__main__.py +0 -5
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/LICENSE +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/output/__init__.py +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/transformers/__init__.py +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/transformers/grouper.py +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/transformers/team_mapper.py +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/transformers/time_grouper.py +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/utils/__init__.py +0 -0
- {code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/utils/math.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: code-maat-python
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Modern Python tool for mining and analyzing version control system data
|
|
5
5
|
License: GPL-3.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -25,7 +25,7 @@ Project-URL: Homepage, https://github.com/hydrosquall/code-maat-python
|
|
|
25
25
|
Project-URL: Repository, https://github.com/hydrosquall/code-maat-python
|
|
26
26
|
Description-Content-Type: text/markdown
|
|
27
27
|
|
|
28
|
-
# code-maat
|
|
28
|
+
# code-maat
|
|
29
29
|
|
|
30
30
|
[](https://opensource.org/licenses/GPL-3.0)
|
|
31
31
|
[](https://www.python.org/downloads/)
|
|
@@ -34,7 +34,7 @@ A Python implementation of [Code Maat](https://github.com/adamtornhill/code-maat
|
|
|
34
34
|
|
|
35
35
|
## Overview
|
|
36
36
|
|
|
37
|
-
code-maat
|
|
37
|
+
code-maat extracts insights from version control history:
|
|
38
38
|
|
|
39
39
|
- Temporal coupling: Files that change together frequently
|
|
40
40
|
- Code churn: Change frequency and stability metrics
|
|
@@ -58,11 +58,11 @@ Research shows that files with high temporal coupling have 2-10x higher defect r
|
|
|
58
58
|
|
|
59
59
|
```bash
|
|
60
60
|
# Using pip
|
|
61
|
-
pip install code-maat
|
|
61
|
+
pip install code-maat
|
|
62
62
|
|
|
63
63
|
# From source with Poetry
|
|
64
|
-
git clone https://github.com/hydrosquall/code-maat
|
|
65
|
-
cd code-maat
|
|
64
|
+
git clone https://github.com/hydrosquall/code-maat.git
|
|
65
|
+
cd code-maat
|
|
66
66
|
poetry install
|
|
67
67
|
```
|
|
68
68
|
|
|
@@ -78,7 +78,7 @@ git log --all -M -C --numstat --date=short --pretty=format:'--%h--%cd--%cn' > gi
|
|
|
78
78
|
Run a coupling analysis to find files that frequently change together:
|
|
79
79
|
|
|
80
80
|
```bash
|
|
81
|
-
code-maat
|
|
81
|
+
code-maat coupling git.log --min-coupling 50 --rows 10
|
|
82
82
|
# Or: python -m code_maat_python coupling git.log --min-coupling 50 --rows 10
|
|
83
83
|
```
|
|
84
84
|
|
|
@@ -94,7 +94,7 @@ This indicates `user.py` and `profile.py` change together in 87% of commits wher
|
|
|
94
94
|
|
|
95
95
|
## Available Analyses
|
|
96
96
|
|
|
97
|
-
code-maat
|
|
97
|
+
code-maat provides 17 analysis types:
|
|
98
98
|
|
|
99
99
|
| Command | Description | Use Case |
|
|
100
100
|
|---------|-------------|----------|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# code-maat
|
|
1
|
+
# code-maat
|
|
2
2
|
|
|
3
3
|
[](https://opensource.org/licenses/GPL-3.0)
|
|
4
4
|
[](https://www.python.org/downloads/)
|
|
@@ -7,7 +7,7 @@ A Python implementation of [Code Maat](https://github.com/adamtornhill/code-maat
|
|
|
7
7
|
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
code-maat
|
|
10
|
+
code-maat extracts insights from version control history:
|
|
11
11
|
|
|
12
12
|
- Temporal coupling: Files that change together frequently
|
|
13
13
|
- Code churn: Change frequency and stability metrics
|
|
@@ -31,11 +31,11 @@ Research shows that files with high temporal coupling have 2-10x higher defect r
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
# Using pip
|
|
34
|
-
pip install code-maat
|
|
34
|
+
pip install code-maat
|
|
35
35
|
|
|
36
36
|
# From source with Poetry
|
|
37
|
-
git clone https://github.com/hydrosquall/code-maat
|
|
38
|
-
cd code-maat
|
|
37
|
+
git clone https://github.com/hydrosquall/code-maat.git
|
|
38
|
+
cd code-maat
|
|
39
39
|
poetry install
|
|
40
40
|
```
|
|
41
41
|
|
|
@@ -51,7 +51,7 @@ git log --all -M -C --numstat --date=short --pretty=format:'--%h--%cd--%cn' > gi
|
|
|
51
51
|
Run a coupling analysis to find files that frequently change together:
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
code-maat
|
|
54
|
+
code-maat coupling git.log --min-coupling 50 --rows 10
|
|
55
55
|
# Or: python -m code_maat_python coupling git.log --min-coupling 50 --rows 10
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -67,7 +67,7 @@ This indicates `user.py` and `profile.py` change together in 87% of commits wher
|
|
|
67
67
|
|
|
68
68
|
## Available Analyses
|
|
69
69
|
|
|
70
|
-
code-maat
|
|
70
|
+
code-maat provides 17 analysis types:
|
|
71
71
|
|
|
72
72
|
| Command | Description | Use Case |
|
|
73
73
|
|---------|-------------|----------|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"""
|
|
2
|
-
code-maat
|
|
2
|
+
code-maat: Modern Python tool for mining VCS data with pandas.
|
|
3
3
|
|
|
4
4
|
A rewrite of Code Maat (by Adam Tornhill) using pandas for data analysis.
|
|
5
5
|
"""
|
|
6
6
|
|
|
7
|
-
__version__ = "0.
|
|
7
|
+
__version__ = "0.2.0"
|
|
8
8
|
__author__ = "Cameron Yick"
|
|
9
9
|
__license__ = "GPL-3.0"
|
|
10
10
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"""Command-line interface for code-maat
|
|
1
|
+
"""Command-line interface for code-maat.
|
|
2
2
|
|
|
3
3
|
Modern CLI using click framework with subcommands for each analysis type.
|
|
4
4
|
"""
|
|
@@ -12,6 +12,7 @@ from typing import Any
|
|
|
12
12
|
import click
|
|
13
13
|
import pandas as pd
|
|
14
14
|
|
|
15
|
+
from code_maat_python import __version__
|
|
15
16
|
from code_maat_python.analyses import (
|
|
16
17
|
analyze_authors,
|
|
17
18
|
analyze_coupling,
|
|
@@ -179,9 +180,9 @@ def handle_analysis_error(e: Exception) -> None:
|
|
|
179
180
|
|
|
180
181
|
# Main command group
|
|
181
182
|
@click.group()
|
|
182
|
-
@click.version_option(version=
|
|
183
|
+
@click.version_option(version=__version__, prog_name="code-maat")
|
|
183
184
|
def main() -> None:
|
|
184
|
-
"""Code Maat
|
|
185
|
+
"""Code Maat - Modern Python tool for mining version control data.
|
|
185
186
|
|
|
186
187
|
Analyzes git repository logs to identify patterns, coupling, churn,
|
|
187
188
|
and other metrics useful for understanding code evolution.
|
|
@@ -193,10 +194,10 @@ def main() -> None:
|
|
|
193
194
|
--pretty=format:'--%h--%cd--%cn' > git.log
|
|
194
195
|
|
|
195
196
|
2. Run an analysis:
|
|
196
|
-
code-maat
|
|
197
|
+
code-maat coupling git.log --min-coupling 50
|
|
197
198
|
|
|
198
199
|
3. Save results to CSV:
|
|
199
|
-
code-maat
|
|
200
|
+
code-maat revisions git.log --output results.csv
|
|
200
201
|
"""
|
|
201
202
|
pass
|
|
202
203
|
|
|
@@ -218,9 +219,9 @@ def authors(
|
|
|
218
219
|
|
|
219
220
|
\b
|
|
220
221
|
Example:
|
|
221
|
-
code-maat
|
|
222
|
-
code-maat
|
|
223
|
-
code-maat
|
|
222
|
+
code-maat authors git.log
|
|
223
|
+
code-maat authors git.log --output authors.csv
|
|
224
|
+
code-maat authors git.log --group layers.txt --rows 20
|
|
224
225
|
"""
|
|
225
226
|
try:
|
|
226
227
|
df = parse_git_log(logfile)
|
|
@@ -248,9 +249,9 @@ def revisions(
|
|
|
248
249
|
|
|
249
250
|
\b
|
|
250
251
|
Example:
|
|
251
|
-
code-maat
|
|
252
|
-
code-maat
|
|
253
|
-
code-maat
|
|
252
|
+
code-maat revisions git.log
|
|
253
|
+
code-maat revisions git.log --output revisions.csv
|
|
254
|
+
code-maat revisions git.log --group layers.txt --rows 10
|
|
254
255
|
"""
|
|
255
256
|
try:
|
|
256
257
|
df = parse_git_log(logfile)
|
|
@@ -278,9 +279,9 @@ def entities(
|
|
|
278
279
|
|
|
279
280
|
\b
|
|
280
281
|
Example:
|
|
281
|
-
code-maat
|
|
282
|
-
code-maat
|
|
283
|
-
code-maat
|
|
282
|
+
code-maat entities git.log
|
|
283
|
+
code-maat entities git.log --output entities.csv
|
|
284
|
+
code-maat entities git.log --group layers.txt
|
|
284
285
|
"""
|
|
285
286
|
try:
|
|
286
287
|
df = parse_git_log(logfile)
|
|
@@ -308,9 +309,9 @@ def summary(
|
|
|
308
309
|
|
|
309
310
|
\b
|
|
310
311
|
Example:
|
|
311
|
-
code-maat
|
|
312
|
-
code-maat
|
|
313
|
-
code-maat
|
|
312
|
+
code-maat summary git.log
|
|
313
|
+
code-maat summary git.log --output summary.csv
|
|
314
|
+
code-maat summary git.log --group layers.txt
|
|
314
315
|
"""
|
|
315
316
|
try:
|
|
316
317
|
df = parse_git_log(logfile)
|
|
@@ -384,11 +385,11 @@ def coupling(
|
|
|
384
385
|
|
|
385
386
|
\b
|
|
386
387
|
Example:
|
|
387
|
-
code-maat
|
|
388
|
-
code-maat
|
|
389
|
-
code-maat
|
|
390
|
-
code-maat
|
|
391
|
-
code-maat
|
|
388
|
+
code-maat coupling git.log
|
|
389
|
+
code-maat coupling git.log --min-coupling 50
|
|
390
|
+
code-maat coupling git.log --min-revs 10 --min-shared-revs 5
|
|
391
|
+
code-maat coupling git.log --group layers.txt --rows 20
|
|
392
|
+
code-maat coupling git.log --output coupling.csv
|
|
392
393
|
"""
|
|
393
394
|
try:
|
|
394
395
|
# Validate parameters
|
|
@@ -442,10 +443,10 @@ def soc(
|
|
|
442
443
|
|
|
443
444
|
\b
|
|
444
445
|
Example:
|
|
445
|
-
code-maat
|
|
446
|
-
code-maat
|
|
447
|
-
code-maat
|
|
448
|
-
code-maat
|
|
446
|
+
code-maat soc git.log
|
|
447
|
+
code-maat soc git.log --max-changeset-size 50
|
|
448
|
+
code-maat soc git.log --group layers.txt --rows 10
|
|
449
|
+
code-maat soc git.log --output soc.csv
|
|
449
450
|
"""
|
|
450
451
|
try:
|
|
451
452
|
df = parse_git_log(logfile)
|
|
@@ -473,9 +474,9 @@ def abs_churn_cmd(
|
|
|
473
474
|
|
|
474
475
|
\b
|
|
475
476
|
Example:
|
|
476
|
-
code-maat
|
|
477
|
-
code-maat
|
|
478
|
-
code-maat
|
|
477
|
+
code-maat abs-churn git.log
|
|
478
|
+
code-maat abs-churn git.log --output churn.csv
|
|
479
|
+
code-maat abs-churn git.log --rows 30
|
|
479
480
|
"""
|
|
480
481
|
try:
|
|
481
482
|
df = parse_git_log(logfile)
|
|
@@ -503,9 +504,9 @@ def author_churn_cmd(
|
|
|
503
504
|
|
|
504
505
|
\b
|
|
505
506
|
Example:
|
|
506
|
-
code-maat
|
|
507
|
-
code-maat
|
|
508
|
-
code-maat
|
|
507
|
+
code-maat author-churn git.log
|
|
508
|
+
code-maat author-churn git.log --team-map-file teams.csv
|
|
509
|
+
code-maat author-churn git.log --output author-churn.csv
|
|
509
510
|
"""
|
|
510
511
|
try:
|
|
511
512
|
df = parse_git_log(logfile)
|
|
@@ -533,9 +534,9 @@ def entity_churn_cmd(
|
|
|
533
534
|
|
|
534
535
|
\b
|
|
535
536
|
Example:
|
|
536
|
-
code-maat
|
|
537
|
-
code-maat
|
|
538
|
-
code-maat
|
|
537
|
+
code-maat entity-churn git.log
|
|
538
|
+
code-maat entity-churn git.log --group layers.txt --rows 20
|
|
539
|
+
code-maat entity-churn git.log --output entity-churn.csv
|
|
539
540
|
"""
|
|
540
541
|
try:
|
|
541
542
|
df = parse_git_log(logfile)
|
|
@@ -563,9 +564,9 @@ def entity_ownership_cmd(
|
|
|
563
564
|
|
|
564
565
|
\b
|
|
565
566
|
Example:
|
|
566
|
-
code-maat
|
|
567
|
-
code-maat
|
|
568
|
-
code-maat
|
|
567
|
+
code-maat entity-ownership git.log
|
|
568
|
+
code-maat entity-ownership git.log --group layers.txt
|
|
569
|
+
code-maat entity-ownership git.log --output ownership.csv
|
|
569
570
|
"""
|
|
570
571
|
try:
|
|
571
572
|
df = parse_git_log(logfile)
|
|
@@ -593,9 +594,9 @@ def main_dev_cmd(
|
|
|
593
594
|
|
|
594
595
|
\b
|
|
595
596
|
Example:
|
|
596
|
-
code-maat
|
|
597
|
-
code-maat
|
|
598
|
-
code-maat
|
|
597
|
+
code-maat main-dev git.log
|
|
598
|
+
code-maat main-dev git.log --group layers.txt --rows 15
|
|
599
|
+
code-maat main-dev git.log --output main-dev.csv
|
|
599
600
|
"""
|
|
600
601
|
try:
|
|
601
602
|
df = parse_git_log(logfile)
|
|
@@ -623,9 +624,9 @@ def refactoring_main_dev_cmd(
|
|
|
623
624
|
|
|
624
625
|
\b
|
|
625
626
|
Example:
|
|
626
|
-
code-maat
|
|
627
|
-
code-maat
|
|
628
|
-
code-maat
|
|
627
|
+
code-maat refactoring-main-dev git.log
|
|
628
|
+
code-maat refactoring-main-dev git.log --rows 10
|
|
629
|
+
code-maat refactoring-main-dev git.log --output refactoring.csv
|
|
629
630
|
"""
|
|
630
631
|
try:
|
|
631
632
|
df = parse_git_log(logfile)
|
|
@@ -653,9 +654,9 @@ def entity_effort_cmd(
|
|
|
653
654
|
|
|
654
655
|
\b
|
|
655
656
|
Example:
|
|
656
|
-
code-maat
|
|
657
|
-
code-maat
|
|
658
|
-
code-maat
|
|
657
|
+
code-maat entity-effort git.log
|
|
658
|
+
code-maat entity-effort git.log --group layers.txt
|
|
659
|
+
code-maat entity-effort git.log --output effort.csv
|
|
659
660
|
"""
|
|
660
661
|
try:
|
|
661
662
|
df = parse_git_log(logfile)
|
|
@@ -683,9 +684,9 @@ def main_dev_by_revs_cmd(
|
|
|
683
684
|
|
|
684
685
|
\b
|
|
685
686
|
Example:
|
|
686
|
-
code-maat
|
|
687
|
-
code-maat
|
|
688
|
-
code-maat
|
|
687
|
+
code-maat main-dev-by-revs git.log
|
|
688
|
+
code-maat main-dev-by-revs git.log --rows 15
|
|
689
|
+
code-maat main-dev-by-revs git.log --output main-dev-revs.csv
|
|
689
690
|
"""
|
|
690
691
|
try:
|
|
691
692
|
df = parse_git_log(logfile)
|
|
@@ -713,9 +714,9 @@ def fragmentation_cmd(
|
|
|
713
714
|
|
|
714
715
|
\b
|
|
715
716
|
Example:
|
|
716
|
-
code-maat
|
|
717
|
-
code-maat
|
|
718
|
-
code-maat
|
|
717
|
+
code-maat fragmentation git.log
|
|
718
|
+
code-maat fragmentation git.log --group layers.txt --rows 20
|
|
719
|
+
code-maat fragmentation git.log --output fragmentation.csv
|
|
719
720
|
"""
|
|
720
721
|
try:
|
|
721
722
|
df = parse_git_log(logfile)
|
|
@@ -750,10 +751,10 @@ def age(
|
|
|
750
751
|
|
|
751
752
|
\b
|
|
752
753
|
Example:
|
|
753
|
-
code-maat
|
|
754
|
-
code-maat
|
|
755
|
-
code-maat
|
|
756
|
-
code-maat
|
|
754
|
+
code-maat age git.log
|
|
755
|
+
code-maat age git.log --reference-date 2023-12-31
|
|
756
|
+
code-maat age git.log --group layers.txt --rows 25
|
|
757
|
+
code-maat age git.log --output age.csv
|
|
757
758
|
"""
|
|
758
759
|
try:
|
|
759
760
|
df = parse_git_log(logfile)
|
|
@@ -804,10 +805,10 @@ def communication_cmd(
|
|
|
804
805
|
|
|
805
806
|
\b
|
|
806
807
|
Example:
|
|
807
|
-
code-maat
|
|
808
|
-
code-maat
|
|
809
|
-
code-maat
|
|
810
|
-
code-maat
|
|
808
|
+
code-maat communication git.log
|
|
809
|
+
code-maat communication git.log --min-shared 10 --min-coupling 50
|
|
810
|
+
code-maat communication git.log --team-map-file teams.csv --rows 15
|
|
811
|
+
code-maat communication git.log --output communication.csv
|
|
811
812
|
"""
|
|
812
813
|
try:
|
|
813
814
|
df = parse_git_log(logfile)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "code-maat-python"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.2.0"
|
|
4
4
|
description = "Modern Python tool for mining and analyzing version control system data"
|
|
5
5
|
authors = ["Cameron Yick <cameron.yick@gmail.com>"]
|
|
6
6
|
license = "GPL-3.0"
|
|
@@ -34,7 +34,7 @@ pre-commit = "^3.3.0"
|
|
|
34
34
|
pandas-stubs = "^2.0.0"
|
|
35
35
|
|
|
36
36
|
[tool.poetry.scripts]
|
|
37
|
-
code-maat
|
|
37
|
+
code-maat = "code_maat_python.cli:main"
|
|
38
38
|
|
|
39
39
|
[build-system]
|
|
40
40
|
requires = ["poetry-core"]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/transformers/team_mapper.py
RENAMED
|
File without changes
|
{code_maat_python-0.1.1 → code_maat_python-0.2.0}/code_maat_python/transformers/time_grouper.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|