Skip to content

Commit 62aa1f8

Browse files
committed
cmd/gocyclo: remove meaningless -total and -total-short options
Fixes #47
1 parent f2d3760 commit 62aa1f8

File tree

3 files changed

+4
-18
lines changed

3 files changed

+4
-18
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.6.0] - 2022-06-15
8+
### Changed
9+
- Breaking: remove meaningless `-total` and `-total-short` options
10+
711
## [0.5.1] - 2022-04-06
812
### Fixed
913
- Don't skip directories `.` and `..`

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ Flags:
5151
-top N show the top N most complex functions only
5252
-avg, -avg-short show the average complexity over all functions;
5353
the short option prints the value without a label
54-
-total, -total-short show the total complexity for all functions;
55-
the short option prints the value without a label
5654
-ignore REGEX exclude files matching the given regular expression
5755
5856
The output fields for each line are:

cmd/gocyclo/main.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
// -top N show the top N most complex functions only
1717
// -avg, -avg-short show the average complexity;
1818
// the short option prints the value without a label
19-
// -total, -total-short show the total complexity;
20-
// the short option prints the value without a label
2119
// -ignore REGEX exclude files matching the given regular expression
2220
//
2321
// The output fields for each line are:
@@ -44,8 +42,6 @@ Flags:
4442
-top N show the top N most complex functions only
4543
-avg, -avg-short show the average complexity over all functions;
4644
the short option prints the value without a label
47-
-total, -total-short show the total complexity for all functions;
48-
the short option prints the value without a label
4945
-ignore REGEX exclude files matching the given regular expression
5046
5147
The output fields for each line are:
@@ -57,8 +53,6 @@ func main() {
5753
top := flag.Int("top", -1, "show the top N most complex functions only")
5854
avg := flag.Bool("avg", false, "show the average complexity")
5955
avgShort := flag.Bool("avg-short", false, "show the average complexity without a label")
60-
total := flag.Bool("total", false, "show the total complexity")
61-
totalShort := flag.Bool("total-short", false, "show the total complexity without a label")
6256
ignore := flag.String("ignore", "", "exclude files matching the given regular expression")
6357

6458
log.SetFlags(0)
@@ -77,9 +71,6 @@ func main() {
7771
if *avg || *avgShort {
7872
printAverage(allStats, *avgShort)
7973
}
80-
if *total || *totalShort {
81-
printTotal(allStats, *totalShort)
82-
}
8374

8475
if *over > 0 && len(shownStats) > 0 {
8576
os.Exit(1)
@@ -110,13 +101,6 @@ func printAverage(s gocyclo.Stats, short bool) {
110101
fmt.Printf("%.3g\n", s.AverageComplexity())
111102
}
112103

113-
func printTotal(s gocyclo.Stats, short bool) {
114-
if !short {
115-
fmt.Print("Total: ")
116-
}
117-
fmt.Printf("%d\n", s.TotalComplexity())
118-
}
119-
120104
func usage() {
121105
_, _ = fmt.Fprint(os.Stderr, usageDoc)
122106
os.Exit(2)

0 commit comments

Comments
 (0)