Reduce cyclomatic complexity functions
- Dominant language
- Go
- Stars
- 14
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Description
```
spreadsheet/spreadsheet.go:166:1: cyclomatic complexity 15 of func `(*Sheet).setCell` is high (> 10) (gocyclo)
func (s *Sheet) setCell(cell *xlsx.Cell, val interface{}) {
^
inv/inv.go:294:1: cyclomatic complexity 30 of func `typeToSheet` is high (> 10) (gocyclo)
func typeToSheet(items interface{}) (string, error) {
^
inv/inv.go:242:1: cyclomatic complexity 12 of func `(*Inv).aggregate` is high (> 10) (gocyclo)
func (inv *Inv) aggregate() error {
^
```
Contributor guide
Research direction
Start by reading spreadsheet/spreadsheet.go around (*Sheet).setCell and inv/inv.go around (*Inv).aggregate and typeToSheet. Run gocyclo on those functions to establish the reported values. Done means the listed functions are refactored without changing behavior and each falls below the reported complexity threshold of 10.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100