File tree Expand file tree Collapse file tree 5 files changed +49
-1
lines changed Expand file tree Collapse file tree 5 files changed +49
-1
lines changed Original file line number Diff line number Diff line change 41
41
uses: getcodelimit/codelimit-action@v1
42
42
` ` `
43
43
44
+ # ## Status badge
45
+
46
+ A status badge is stored after each run in the `_codelimit_reports` branch of
47
+ the repository.
48
+
49
+ To get the Markdown for the badge run the CodeLimit CLI in a local checkout of
50
+ the repository, for example :
51
+
52
+ ` ` ` shell
53
+
54
+ $ codelimit badge
55
+ [](https://github.com/getcodelimit/codelimit/blob/_codelimit_repor
57
+ ts/main/codelimit.md)
58
+
59
+ ✔ Badge Markdown copied to clipboard!
60
+ ` ` `
61
+
62
+ # ### Meaning of the badge
63
+
64
+ If a repository contains functions that *exceed 60 lines of code*, the badge
65
+ will show :
66
+
67
+ <div align="center">
68
+ <img src="../../../assets/badge-needs-refactoring.svg" alt="Badge needs refactoring" class="off-glb">
69
+ </div>
70
+
71
+ If a repository contains *no functions that exceed 30 lines of code*, the badge
72
+ will show :
73
+
74
+ <div align="center">
75
+ <img src="../../../assets/badge-100.svg" alt="Badge needs refactoring" class="off-glb">
76
+ </div>
77
+
78
+ Otherwise, the badge will show the percentage of code that does not exceed 30
79
+ lines of code.
80
+
81
+ If that percentage is 80% or higher, the badge will be green :
82
+
83
+ <div align="center">
84
+ <img src="../../../assets/badge-88.svg" alt="Badge needs refactoring" class="off-glb">
85
+ </div>
86
+
87
+ If that percentage is below 80%, the badge will be orange.
88
+
44
89
# # Pre-commit hook
45
90
46
91
CodeLimit can be installed as a [pre-commit](https://pre-commit.com/) hook so
Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ markdown_extensions:
38
38
- pymdownx.snippets
39
39
nav :
40
40
- CodeLimit : ' index.md'
41
- - ' why-function-length.md'
42
41
- Getting Started :
43
42
- ' getting-started/development-workflow.md'
44
43
- ' getting-started/standalone-usage.md'
45
44
- ' configuration.md'
45
+ - ' why-function-length.md'
46
46
- ' faq.md'
47
47
- ' development.md'
You can’t perform that action at this time.
0 commit comments