complexipy 5.0.0__tar.gz → 5.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.
Files changed (51) hide show
  1. {complexipy-5.0.0 → complexipy-5.2.0}/Cargo.lock +72 -66
  2. {complexipy-5.0.0 → complexipy-5.2.0}/Cargo.toml +1 -1
  3. {complexipy-5.0.0 → complexipy-5.2.0}/PKG-INFO +20 -8
  4. {complexipy-5.0.0 → complexipy-5.2.0}/README.md +18 -6
  5. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/main.py +1 -1
  6. complexipy-5.2.0/docs/about.md +83 -0
  7. complexipy-5.2.0/docs/comparison-with-ruff.md +276 -0
  8. {complexipy-5.0.0 → complexipy-5.2.0}/docs/index.md +18 -6
  9. complexipy-5.2.0/docs/understanding-scores.md +228 -0
  10. complexipy-5.2.0/docs/usage-guide.md +570 -0
  11. {complexipy-5.0.0 → complexipy-5.2.0}/mkdocs.yml +7 -0
  12. {complexipy-5.0.0 → complexipy-5.2.0}/src/cognitive_complexity/utils.rs +21 -0
  13. {complexipy-5.0.0 → complexipy-5.2.0}/.pre-commit-config.yaml +0 -0
  14. {complexipy-5.0.0 → complexipy-5.2.0}/LICENSE +0 -0
  15. {complexipy-5.0.0 → complexipy-5.2.0}/build-wasm.sh +0 -0
  16. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/__init__.py +0 -0
  17. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/_complexipy.pyi +0 -0
  18. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/api.py +0 -0
  19. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/py.typed +0 -0
  20. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/types.py +0 -0
  21. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/__init__.py +0 -0
  22. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/cache.py +0 -0
  23. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/csv.py +0 -0
  24. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/json.py +0 -0
  25. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/output.py +0 -0
  26. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/snapshot.py +0 -0
  27. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy/utils/toml.py +0 -0
  28. {complexipy-5.0.0 → complexipy-5.2.0}/complexipy.toml +0 -0
  29. {complexipy-5.0.0 → complexipy-5.2.0}/docs/img/complexipy_icon.svg +0 -0
  30. {complexipy-5.0.0 → complexipy-5.2.0}/pyproject.toml +0 -0
  31. {complexipy-5.0.0 → complexipy-5.2.0}/serve-web-version.sh +0 -0
  32. {complexipy-5.0.0 → complexipy-5.2.0}/src/classes/mod.rs +0 -0
  33. {complexipy-5.0.0 → complexipy-5.2.0}/src/cognitive_complexity/mod.rs +0 -0
  34. {complexipy-5.0.0 → complexipy-5.2.0}/src/lib.rs +0 -0
  35. {complexipy-5.0.0 → complexipy-5.2.0}/src/wasm.rs +0 -0
  36. {complexipy-5.0.0 → complexipy-5.2.0}/uv.lock +0 -0
  37. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/.vscode-test.mjs +0 -0
  38. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/.vscodeignore +0 -0
  39. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/CHANGELOG.md +0 -0
  40. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/LICENSE +0 -0
  41. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/README.md +0 -0
  42. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/eslint.config.mjs +0 -0
  43. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/extension.js +0 -0
  44. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/img/complexipy.png +0 -0
  45. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/img/complexipy_icon.png +0 -0
  46. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/img/complexipy_icon.svg +0 -0
  47. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/jsconfig.json +0 -0
  48. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/package-lock.json +0 -0
  49. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/package.json +0 -0
  50. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/test/extension.test.js +0 -0
  51. {complexipy-5.0.0 → complexipy-5.2.0}/vscode/complexipy/test/statusbar.test.js +0 -0
@@ -22,7 +22,7 @@ dependencies = [
22
22
  "manyhow",
23
23
  "proc-macro2",
24
24
  "quote",
25
- "syn 2.0.111",
25
+ "syn 2.0.114",
26
26
  ]
27
27
 
28
28
  [[package]]
@@ -38,7 +38,7 @@ dependencies = [
38
38
  "proc-macro2",
39
39
  "quote",
40
40
  "quote-use",
41
- "syn 2.0.111",
41
+ "syn 2.0.114",
42
42
  ]
43
43
 
44
44
  [[package]]
@@ -66,9 +66,9 @@ dependencies = [
66
66
 
67
67
  [[package]]
68
68
  name = "bumpalo"
69
- version = "3.19.0"
69
+ version = "3.19.1"
70
70
  source = "registry+https://github.com/rust-lang/crates.io-index"
71
- checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43"
71
+ checksum = "5dd9dc738b7a8311c7ade152424974d8115f2cdad61e8dab8dac9f2362298510"
72
72
 
73
73
  [[package]]
74
74
  name = "castaway"
@@ -107,7 +107,7 @@ dependencies = [
107
107
 
108
108
  [[package]]
109
109
  name = "complexipy"
110
- version = "5.0.0"
110
+ version = "5.2.0"
111
111
  dependencies = [
112
112
  "console_error_panic_hook",
113
113
  "csv",
@@ -203,7 +203,7 @@ checksum = "ef941ded77d15ca19b40374869ac6000af1c9f2a4c0f3d4c70926287e6364a8f"
203
203
  dependencies = [
204
204
  "proc-macro2",
205
205
  "quote",
206
- "syn 2.0.111",
206
+ "syn 2.0.114",
207
207
  ]
208
208
 
209
209
  [[package]]
@@ -242,7 +242,7 @@ checksum = "b5a443e77201a230c25f0c11574e9b20e5705f749520e0f30ab0d0974fb1a794"
242
242
  dependencies = [
243
243
  "attribute-derive",
244
244
  "quote",
245
- "syn 2.0.111",
245
+ "syn 2.0.114",
246
246
  ]
247
247
 
248
248
  [[package]]
@@ -268,9 +268,9 @@ dependencies = [
268
268
 
269
269
  [[package]]
270
270
  name = "getrandom"
271
- version = "0.2.16"
271
+ version = "0.2.17"
272
272
  source = "registry+https://github.com/rust-lang/crates.io-index"
273
- checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592"
273
+ checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0"
274
274
  dependencies = [
275
275
  "cfg-if",
276
276
  "libc",
@@ -364,7 +364,7 @@ dependencies = [
364
364
  "heck",
365
365
  "proc-macro2",
366
366
  "quote",
367
- "syn 2.0.111",
367
+ "syn 2.0.114",
368
368
  ]
369
369
 
370
370
  [[package]]
@@ -378,15 +378,15 @@ dependencies = [
378
378
 
379
379
  [[package]]
380
380
  name = "itoa"
381
- version = "1.0.15"
381
+ version = "1.0.17"
382
382
  source = "registry+https://github.com/rust-lang/crates.io-index"
383
- checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c"
383
+ checksum = "92ecc6618181def0457392ccd0ee51198e065e016d1d527a7ac1b6dc7c1f09d2"
384
384
 
385
385
  [[package]]
386
386
  name = "js-sys"
387
- version = "0.3.82"
387
+ version = "0.3.85"
388
388
  source = "registry+https://github.com/rust-lang/crates.io-index"
389
- checksum = "b011eec8cc36da2aab2d5cff675ec18454fad408585853910a202391cf9f8e65"
389
+ checksum = "8c942ebf8e95485ca0d52d97da7c5a2c387d0e7f0ba4c35e93bfcaee045955b3"
390
390
  dependencies = [
391
391
  "once_cell",
392
392
  "wasm-bindgen",
@@ -394,9 +394,9 @@ dependencies = [
394
394
 
395
395
  [[package]]
396
396
  name = "libc"
397
- version = "0.2.177"
397
+ version = "0.2.180"
398
398
  source = "registry+https://github.com/rust-lang/crates.io-index"
399
- checksum = "2874a2af47a2325c2001a6e6fad9b16a53b802102b528163885171cf92b15976"
399
+ checksum = "bcc35a38544a891a5f7c865aca548a982ccb3b8650a5b06d0fd33a10283c56fc"
400
400
 
401
401
  [[package]]
402
402
  name = "linux-raw-sys"
@@ -415,9 +415,9 @@ dependencies = [
415
415
 
416
416
  [[package]]
417
417
  name = "log"
418
- version = "0.4.28"
418
+ version = "0.4.29"
419
419
  source = "registry+https://github.com/rust-lang/crates.io-index"
420
- checksum = "34080505efa8e45a4b816c349525ebe327ceaa8559756f0356cba97ef3bf7432"
420
+ checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897"
421
421
 
422
422
  [[package]]
423
423
  name = "manyhow"
@@ -428,7 +428,7 @@ dependencies = [
428
428
  "manyhow-macros",
429
429
  "proc-macro2",
430
430
  "quote",
431
- "syn 2.0.111",
431
+ "syn 2.0.114",
432
432
  ]
433
433
 
434
434
  [[package]]
@@ -532,9 +532,9 @@ dependencies = [
532
532
 
533
533
  [[package]]
534
534
  name = "portable-atomic"
535
- version = "1.11.1"
535
+ version = "1.13.0"
536
536
  source = "registry+https://github.com/rust-lang/crates.io-index"
537
- checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483"
537
+ checksum = "f89776e4d69bb58bc6993e99ffa1d11f228b839984854c7daeb5d37f87cbe950"
538
538
 
539
539
  [[package]]
540
540
  name = "ppv-lite86"
@@ -558,9 +558,9 @@ dependencies = [
558
558
 
559
559
  [[package]]
560
560
  name = "proc-macro2"
561
- version = "1.0.103"
561
+ version = "1.0.106"
562
562
  source = "registry+https://github.com/rust-lang/crates.io-index"
563
- checksum = "5ee95bc4ef87b8d5ba32e8b7714ccc834865276eab0aed5c9958d00ec45f49e8"
563
+ checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934"
564
564
  dependencies = [
565
565
  "unicode-ident",
566
566
  ]
@@ -627,9 +627,9 @@ dependencies = [
627
627
 
628
628
  [[package]]
629
629
  name = "quote"
630
- version = "1.0.42"
630
+ version = "1.0.44"
631
631
  source = "registry+https://github.com/rust-lang/crates.io-index"
632
- checksum = "a338cc41d27e6cc6dce6cefc13a0729dfbb81c262b1f519331575dd80ef3067f"
632
+ checksum = "21b2ebcf727b7760c461f091f9f0f539b77b8e87f2fd88131e7f1b433b3cece4"
633
633
  dependencies = [
634
634
  "proc-macro2",
635
635
  ]
@@ -653,7 +653,7 @@ dependencies = [
653
653
  "proc-macro-utils",
654
654
  "proc-macro2",
655
655
  "quote",
656
- "syn 2.0.111",
656
+ "syn 2.0.114",
657
657
  ]
658
658
 
659
659
  [[package]]
@@ -689,7 +689,7 @@ version = "0.6.4"
689
689
  source = "registry+https://github.com/rust-lang/crates.io-index"
690
690
  checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
691
691
  dependencies = [
692
- "getrandom 0.2.16",
692
+ "getrandom 0.2.17",
693
693
  ]
694
694
 
695
695
  [[package]]
@@ -805,9 +805,9 @@ checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
805
805
 
806
806
  [[package]]
807
807
  name = "rustix"
808
- version = "1.1.2"
808
+ version = "1.1.3"
809
809
  source = "registry+https://github.com/rust-lang/crates.io-index"
810
- checksum = "cd15f8a2c5551a84d56efdc1cd049089e409ac19a3072d5037a17fd70719ff3e"
810
+ checksum = "146c9e247ccc180c1f61615433868c99f3de3ae256a30a43b49f67c2d9171f34"
811
811
  dependencies = [
812
812
  "bitflags",
813
813
  "errno",
@@ -824,9 +824,9 @@ checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d"
824
824
 
825
825
  [[package]]
826
826
  name = "ryu"
827
- version = "1.0.20"
827
+ version = "1.0.22"
828
828
  source = "registry+https://github.com/rust-lang/crates.io-index"
829
- checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f"
829
+ checksum = "a50f4cf475b65d88e057964e0e9bb1f0aa9bbb2036dc65c64596b42932536984"
830
830
 
831
831
  [[package]]
832
832
  name = "same-file"
@@ -881,27 +881,27 @@ checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79"
881
881
  dependencies = [
882
882
  "proc-macro2",
883
883
  "quote",
884
- "syn 2.0.111",
884
+ "syn 2.0.114",
885
885
  ]
886
886
 
887
887
  [[package]]
888
888
  name = "serde_json"
889
- version = "1.0.145"
889
+ version = "1.0.149"
890
890
  source = "registry+https://github.com/rust-lang/crates.io-index"
891
- checksum = "402a6f66d8c709116cf22f558eab210f5a50187f702eb4d7e5ef38d9a7f1c79c"
891
+ checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86"
892
892
  dependencies = [
893
893
  "itoa",
894
894
  "memchr",
895
- "ryu",
896
895
  "serde",
897
896
  "serde_core",
897
+ "zmij",
898
898
  ]
899
899
 
900
900
  [[package]]
901
901
  name = "siphasher"
902
- version = "1.0.1"
902
+ version = "1.0.2"
903
903
  source = "registry+https://github.com/rust-lang/crates.io-index"
904
- checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
904
+ checksum = "b2aa850e253778c88a04c3d7323b043aeda9d3e30d5971937c1855769763678e"
905
905
 
906
906
  [[package]]
907
907
  name = "smallvec"
@@ -928,9 +928,9 @@ dependencies = [
928
928
 
929
929
  [[package]]
930
930
  name = "syn"
931
- version = "2.0.111"
931
+ version = "2.0.114"
932
932
  source = "registry+https://github.com/rust-lang/crates.io-index"
933
- checksum = "390cc9a294ab71bdb1aa2e99d13be9c753cd2d7bd6560c77118597410c4d2e87"
933
+ checksum = "d4d107df263a3013ef9b1879b0df87d706ff80f65a86ea879bd9c31f9b307c2a"
934
934
  dependencies = [
935
935
  "proc-macro2",
936
936
  "quote",
@@ -945,9 +945,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
945
945
 
946
946
  [[package]]
947
947
  name = "tempfile"
948
- version = "3.23.0"
948
+ version = "3.24.0"
949
949
  source = "registry+https://github.com/rust-lang/crates.io-index"
950
- checksum = "2d31c77bdf42a745371d260a26ca7163f1e0924b64afa0b688e61b5a9fa02f16"
950
+ checksum = "655da9c7eb6305c55742045d5a8d2037996d61d8de95806335c7c86ce0f82e9c"
951
951
  dependencies = [
952
952
  "fastrand",
953
953
  "getrandom 0.3.4",
@@ -958,22 +958,22 @@ dependencies = [
958
958
 
959
959
  [[package]]
960
960
  name = "thiserror"
961
- version = "2.0.17"
961
+ version = "2.0.18"
962
962
  source = "registry+https://github.com/rust-lang/crates.io-index"
963
- checksum = "f63587ca0f12b72a0600bcba1d40081f830876000bb46dd2337a3051618f4fc8"
963
+ checksum = "4288b5bcbc7920c07a1149a35cf9590a2aa808e0bc1eafaade0b80947865fbc4"
964
964
  dependencies = [
965
965
  "thiserror-impl",
966
966
  ]
967
967
 
968
968
  [[package]]
969
969
  name = "thiserror-impl"
970
- version = "2.0.17"
970
+ version = "2.0.18"
971
971
  source = "registry+https://github.com/rust-lang/crates.io-index"
972
- checksum = "3ff15c8ecd7de3849db632e14d18d2571fa09dfc5ed93479bc4485c7a517c913"
972
+ checksum = "ebc4ee7f67670e9b64d05fa4253e753e016c6c95ff35b89b7941d6b856dec1d5"
973
973
  dependencies = [
974
974
  "proc-macro2",
975
975
  "quote",
976
- "syn 2.0.111",
976
+ "syn 2.0.114",
977
977
  ]
978
978
 
979
979
  [[package]]
@@ -1058,18 +1058,18 @@ checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b"
1058
1058
 
1059
1059
  [[package]]
1060
1060
  name = "wasip2"
1061
- version = "1.0.1+wasi-0.2.4"
1061
+ version = "1.0.2+wasi-0.2.9"
1062
1062
  source = "registry+https://github.com/rust-lang/crates.io-index"
1063
- checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7"
1063
+ checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5"
1064
1064
  dependencies = [
1065
1065
  "wit-bindgen",
1066
1066
  ]
1067
1067
 
1068
1068
  [[package]]
1069
1069
  name = "wasm-bindgen"
1070
- version = "0.2.105"
1070
+ version = "0.2.108"
1071
1071
  source = "registry+https://github.com/rust-lang/crates.io-index"
1072
- checksum = "da95793dfc411fbbd93f5be7715b0578ec61fe87cb1a42b12eb625caa5c5ea60"
1072
+ checksum = "64024a30ec1e37399cf85a7ffefebdb72205ca1c972291c51512360d90bd8566"
1073
1073
  dependencies = [
1074
1074
  "cfg-if",
1075
1075
  "once_cell",
@@ -1080,9 +1080,9 @@ dependencies = [
1080
1080
 
1081
1081
  [[package]]
1082
1082
  name = "wasm-bindgen-macro"
1083
- version = "0.2.105"
1083
+ version = "0.2.108"
1084
1084
  source = "registry+https://github.com/rust-lang/crates.io-index"
1085
- checksum = "04264334509e04a7bf8690f2384ef5265f05143a4bff3889ab7a3269adab59c2"
1085
+ checksum = "008b239d9c740232e71bd39e8ef6429d27097518b6b30bdf9086833bd5b6d608"
1086
1086
  dependencies = [
1087
1087
  "quote",
1088
1088
  "wasm-bindgen-macro-support",
@@ -1090,31 +1090,31 @@ dependencies = [
1090
1090
 
1091
1091
  [[package]]
1092
1092
  name = "wasm-bindgen-macro-support"
1093
- version = "0.2.105"
1093
+ version = "0.2.108"
1094
1094
  source = "registry+https://github.com/rust-lang/crates.io-index"
1095
- checksum = "420bc339d9f322e562942d52e115d57e950d12d88983a14c79b86859ee6c7ebc"
1095
+ checksum = "5256bae2d58f54820e6490f9839c49780dff84c65aeab9e772f15d5f0e913a55"
1096
1096
  dependencies = [
1097
1097
  "bumpalo",
1098
1098
  "proc-macro2",
1099
1099
  "quote",
1100
- "syn 2.0.111",
1100
+ "syn 2.0.114",
1101
1101
  "wasm-bindgen-shared",
1102
1102
  ]
1103
1103
 
1104
1104
  [[package]]
1105
1105
  name = "wasm-bindgen-shared"
1106
- version = "0.2.105"
1106
+ version = "0.2.108"
1107
1107
  source = "registry+https://github.com/rust-lang/crates.io-index"
1108
- checksum = "76f218a38c84bcb33c25ec7059b07847d465ce0e0a76b995e134a45adcb6af76"
1108
+ checksum = "1f01b580c9ac74c8d8f0c0e4afb04eeef2acf145458e52c03845ee9cd23e3d12"
1109
1109
  dependencies = [
1110
1110
  "unicode-ident",
1111
1111
  ]
1112
1112
 
1113
1113
  [[package]]
1114
1114
  name = "web-sys"
1115
- version = "0.3.82"
1115
+ version = "0.3.85"
1116
1116
  source = "registry+https://github.com/rust-lang/crates.io-index"
1117
- checksum = "3a1f95c0d03a47f4ae1f7a64643a6bb97465d9b740f0fa8f90ea33915c99a9a1"
1117
+ checksum = "312e32e551d92129218ea9a2452120f4aabc03529ef03e4d0d82fb2780608598"
1118
1118
  dependencies = [
1119
1119
  "js-sys",
1120
1120
  "wasm-bindgen",
@@ -1229,26 +1229,32 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1229
1229
 
1230
1230
  [[package]]
1231
1231
  name = "wit-bindgen"
1232
- version = "0.46.0"
1232
+ version = "0.51.0"
1233
1233
  source = "registry+https://github.com/rust-lang/crates.io-index"
1234
- checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59"
1234
+ checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5"
1235
1235
 
1236
1236
  [[package]]
1237
1237
  name = "zerocopy"
1238
- version = "0.8.30"
1238
+ version = "0.8.35"
1239
1239
  source = "registry+https://github.com/rust-lang/crates.io-index"
1240
- checksum = "4ea879c944afe8a2b25fef16bb4ba234f47c694565e97383b36f3a878219065c"
1240
+ checksum = "fdea86ddd5568519879b8187e1cf04e24fce28f7fe046ceecbce472ff19a2572"
1241
1241
  dependencies = [
1242
1242
  "zerocopy-derive",
1243
1243
  ]
1244
1244
 
1245
1245
  [[package]]
1246
1246
  name = "zerocopy-derive"
1247
- version = "0.8.30"
1247
+ version = "0.8.35"
1248
1248
  source = "registry+https://github.com/rust-lang/crates.io-index"
1249
- checksum = "cf955aa904d6040f70dc8e9384444cb1030aed272ba3cb09bbc4ab9e7c1f34f5"
1249
+ checksum = "0c15e1b46eff7c6c91195752e0eeed8ef040e391cdece7c25376957d5f15df22"
1250
1250
  dependencies = [
1251
1251
  "proc-macro2",
1252
1252
  "quote",
1253
- "syn 2.0.111",
1253
+ "syn 2.0.114",
1254
1254
  ]
1255
+
1256
+ [[package]]
1257
+ name = "zmij"
1258
+ version = "1.0.17"
1259
+ source = "registry+https://github.com/rust-lang/crates.io-index"
1260
+ checksum = "02aae0f83f69aafc94776e879363e9771d7ecbffe2c7fbb6c14c5e00dfe88439"
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "complexipy"
3
- version = "5.0.0"
3
+ version = "5.2.0"
4
4
  edition = "2024"
5
5
  authors = ["Robin Quintero <rohaquinlop301@gmail.com>"]
6
6
  license = "MIT"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: complexipy
3
- Version: 5.0.0
3
+ Version: 5.2.0
4
4
  Classifier: Development Status :: 5 - Production/Stable
5
5
  Classifier: Environment :: Console
6
6
  Classifier: Intended Audience :: Developers
@@ -26,8 +26,8 @@ Author-email: Robin Quintero <rohaquinlop301@gmail.com>
26
26
  License: MIT
27
27
  Requires-Python: >=3.8
28
28
  Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
29
- Project-URL: Homepage, https://github.com/rohaquinlop/complexipy
30
29
  Project-URL: Documentation, https://rohaquinlop.github.io/complexipy/
30
+ Project-URL: Homepage, https://github.com/rohaquinlop/complexipy
31
31
  Project-URL: Repository, https://github.com/rohaquinlop/complexipy
32
32
 
33
33
  # complexipy
@@ -55,12 +55,23 @@ Project-URL: Repository, https://github.com/rohaquinlop/complexipy
55
55
 
56
56
  > Cognitive complexity measures how hard code is to understand by humans, not machines.
57
57
 
58
- Unlike traditional metrics, cognitive complexity considers the mental effort required to read and comprehend code. It identifies truly complex code that needs refactoring, making it perfect for code reviews and maintaining clean codebases.
58
+ Unlike traditional metrics like cyclomatic complexity, cognitive complexity accounts for nesting depth and control flow patterns that affect human comprehension. Inspired by [G. Ann Campbell's research](https://www.sonarsource.com/resources/cognitive-complexity/) at SonarSource, complexipy provides a fast, accurate implementation for Python.
59
59
 
60
60
  **Key benefits:**
61
- - **Human-focused** Aligns with developer intuition
62
- - **Actionable insights** Pinpoints hard-to-understand code
63
- - **Better maintenance** Improves long-term code quality
61
+ - **Human-focused** - Penalizes nesting, flow breaks, and human-unfriendly logic
62
+ - **Actionable insights** - Identifies genuinely hard-to-maintain code
63
+ - **Different from cyclomatic** - Measures readability while cyclomatic measures structural, testing, and branch density
64
+
65
+ ## Common Questions
66
+
67
+ **[How is complexity calculated?](https://rohaquinlop.github.io/complexipy/understanding-scores/)**
68
+ Learn about the scoring algorithm, what each control structure contributes, and how nesting affects the final score.
69
+
70
+ **[How does this compare to Ruff's PLR0912?](https://rohaquinlop.github.io/complexipy/comparison-with-ruff/)**
71
+ Understand the key differences between cyclomatic complexity (Ruff) and cognitive complexity (complexipy), and why you might want to use both.
72
+
73
+ **[Is this a SonarSource/Sonar product?](https://rohaquinlop.github.io/complexipy/about/)**
74
+ No. complexipy is an independent project inspired by G. Ann Campbell's research, but it's not affiliated with or endorsed by SonarSource.
64
75
 
65
76
  ## Installation
66
77
 
@@ -137,7 +148,7 @@ print(f"Complexity: {result.complexity}")
137
148
  ```yaml
138
149
  repos:
139
150
  - repo: https://github.com/rohaquinlop/complexipy-pre-commit
140
- rev: v3.0.0
151
+ rev: v4.2.0
141
152
  hooks:
142
153
  - id: complexipy
143
154
  ```
@@ -282,7 +293,8 @@ FunctionComplexity:
282
293
 
283
294
  <div align="center">
284
295
 
285
- <sub>Inspired by the <a href="https://www.sonarsource.com/resources/cognitive-complexity/">Cognitive Complexity</a> research by SonarSource, G. Ann Campbell</sub>
296
+ <sub>Inspired by the <a href="https://www.sonarsource.com/resources/cognitive-complexity/">Cognitive Complexity</a> research by G. Ann Campbell</sub><br>
297
+ <sub>complexipy is an independent project and is not affiliated with or endorsed by SonarSource</sub>
286
298
 
287
299
  **[Documentation](https://rohaquinlop.github.io/complexipy/) • [PyPI](https://pypi.org/project/complexipy/) • [GitHub](https://github.com/rohaquinlop/complexipy)**
288
300
 
@@ -23,12 +23,23 @@
23
23
 
24
24
  > Cognitive complexity measures how hard code is to understand by humans, not machines.
25
25
 
26
- Unlike traditional metrics, cognitive complexity considers the mental effort required to read and comprehend code. It identifies truly complex code that needs refactoring, making it perfect for code reviews and maintaining clean codebases.
26
+ Unlike traditional metrics like cyclomatic complexity, cognitive complexity accounts for nesting depth and control flow patterns that affect human comprehension. Inspired by [G. Ann Campbell's research](https://www.sonarsource.com/resources/cognitive-complexity/) at SonarSource, complexipy provides a fast, accurate implementation for Python.
27
27
 
28
28
  **Key benefits:**
29
- - **Human-focused** Aligns with developer intuition
30
- - **Actionable insights** Pinpoints hard-to-understand code
31
- - **Better maintenance** Improves long-term code quality
29
+ - **Human-focused** - Penalizes nesting, flow breaks, and human-unfriendly logic
30
+ - **Actionable insights** - Identifies genuinely hard-to-maintain code
31
+ - **Different from cyclomatic** - Measures readability while cyclomatic measures structural, testing, and branch density
32
+
33
+ ## Common Questions
34
+
35
+ **[How is complexity calculated?](https://rohaquinlop.github.io/complexipy/understanding-scores/)**
36
+ Learn about the scoring algorithm, what each control structure contributes, and how nesting affects the final score.
37
+
38
+ **[How does this compare to Ruff's PLR0912?](https://rohaquinlop.github.io/complexipy/comparison-with-ruff/)**
39
+ Understand the key differences between cyclomatic complexity (Ruff) and cognitive complexity (complexipy), and why you might want to use both.
40
+
41
+ **[Is this a SonarSource/Sonar product?](https://rohaquinlop.github.io/complexipy/about/)**
42
+ No. complexipy is an independent project inspired by G. Ann Campbell's research, but it's not affiliated with or endorsed by SonarSource.
32
43
 
33
44
  ## Installation
34
45
 
@@ -105,7 +116,7 @@ print(f"Complexity: {result.complexity}")
105
116
  ```yaml
106
117
  repos:
107
118
  - repo: https://github.com/rohaquinlop/complexipy-pre-commit
108
- rev: v3.0.0
119
+ rev: v4.2.0
109
120
  hooks:
110
121
  - id: complexipy
111
122
  ```
@@ -250,7 +261,8 @@ FunctionComplexity:
250
261
 
251
262
  <div align="center">
252
263
 
253
- <sub>Inspired by the <a href="https://www.sonarsource.com/resources/cognitive-complexity/">Cognitive Complexity</a> research by SonarSource, G. Ann Campbell</sub>
264
+ <sub>Inspired by the <a href="https://www.sonarsource.com/resources/cognitive-complexity/">Cognitive Complexity</a> research by G. Ann Campbell</sub><br>
265
+ <sub>complexipy is an independent project and is not affiliated with or endorsed by SonarSource</sub>
254
266
 
255
267
  **[Documentation](https://rohaquinlop.github.io/complexipy/) • [PyPI](https://pypi.org/project/complexipy/) • [GitHub](https://github.com/rohaquinlop/complexipy)**
256
268
 
@@ -177,7 +177,7 @@ def main(
177
177
  paths, quiet, exclude
178
178
  )
179
179
  files_complexities, failed_paths = result
180
- current_time = datetime.today().strftime("%Y_%m_%d__%H:%M:%S")
180
+ current_time = datetime.today().strftime("%Y_%m_%d__%H-%M-%S")
181
181
  output_csv_path = f"{INVOCATION_PATH}/complexipy_results_{current_time}.csv"
182
182
  output_json_path = (
183
183
  f"{INVOCATION_PATH}/complexipy_results_{current_time}.json"
@@ -0,0 +1,83 @@
1
+ # About complexipy
2
+
3
+ ## Origins and Inspiration
4
+
5
+ complexipy is inspired by the [Cognitive Complexity](https://www.sonarsource.com/resources/cognitive-complexity/) research paper by **G. Ann Campbell** from SonarSource. This groundbreaking work introduced a new approach to measuring code complexity that better aligns with human understanding.
6
+
7
+ !!! info "Independent Project"
8
+ While complexipy implements the cognitive complexity methodology described in Campbell's research, **it is not affiliated with or endorsed by SonarSource or Sonar products**. complexipy is an independent, open-source implementation written in Rust for Python code analysis.
9
+
10
+ ## Why Cognitive Complexity?
11
+
12
+ Cyclomatic complexity measures code structural, testing, and branch density (number of paths) by counting decision points. However, this doesn't reflect how humans actually understand code. Cognitive complexity measures how difficult code is for humans to understand and maintain by penalizing nesting, flow breaks, and human-unfriendly logic.
13
+
14
+ ### Different Approaches to Measuring Complexity
15
+
16
+ Cyclomatic complexity (McCabe, 1976) counts every decision point:
17
+
18
+ ```python
19
+ # Cyclomatic complexity: 4
20
+ def example1(a, b, c):
21
+ if a:
22
+ return 1
23
+ if b:
24
+ return 2
25
+ if c:
26
+ return 3
27
+ return 4
28
+ ```
29
+
30
+ ```python
31
+ # Cyclomatic complexity: 4 (same as above!)
32
+ def example2(a, b, c):
33
+ if a:
34
+ if b:
35
+ if c:
36
+ return 1
37
+ return 4
38
+ ```
39
+
40
+ Both functions have the same cyclomatic complexity, but any developer will tell you `example2` is much harder to understand.
41
+
42
+ ### The Cognitive Complexity Solution
43
+
44
+ Cognitive complexity accounts for nesting:
45
+
46
+ ```python
47
+ # Cognitive complexity: 3
48
+ def example1(a, b, c):
49
+ if a: # +1
50
+ return 1
51
+ if b: # +1
52
+ return 2
53
+ if c: # +1
54
+ return 3
55
+ return 4
56
+ ```
57
+
58
+ ```python
59
+ # Cognitive complexity: 6
60
+ def example2(a, b, c):
61
+ if a: # +1
62
+ if b: # +2 (1 + nesting_level)
63
+ if c: # +3 (1 + nesting_level)
64
+ return 1
65
+ return 4
66
+ ```
67
+
68
+ This aligns with human intuition: nested code requires holding more context in your mind.
69
+
70
+ ## Project Goals
71
+
72
+ 1. **Performance** - Blazingly fast analysis using Rust
73
+ 2. **Accuracy** - Faithful implementation of cognitive complexity principles
74
+ 3. **Accessibility** - Easy integration with Python development workflows
75
+ 4. **Actionability** - Clear, actionable insights for improving code quality
76
+
77
+ ## The Team
78
+
79
+ complexipy is built with ❤️ by [@rohaquinlop](https://github.com/rohaquinlop) and [contributors](https://github.com/rohaquinlop/complexipy/graphs/contributors).
80
+
81
+ ## License
82
+
83
+ complexipy is released under the [MIT License](https://github.com/rohaquinlop/complexipy/blob/main/LICENSE).