Showing 18 of 19 total issues
Function searchChart
has a Cognitive Complexity of 63 (exceeds 20 allowed). Consider refactoring. Open
Open
func searchChart(r []*search.Result, release *release.Release, devel bool) (searchResult, bool, error) {
ret := searchResult{}
// trackedRepos keeps information about a repository we already tracked.
type trackedRepos struct {
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File main.go
has 612 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
/*
Copyright The Helm Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
- Create a ticketCreate a ticket
Function newOutdatedListWriter
has 66 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func newOutdatedListWriter(releases []*release.Release, cfg *action.Configuration, out io.Writer, devel bool) *outdatedListWriter {
var err error
outdated := make([]outdatedElement, 0, len(releases))
dups := make([]repoDuplicate, 0, len(releases))
- Create a ticketCreate a ticket
Function newOutdatedCmd
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func newOutdatedCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewList(cfg)
var outfmt output.Format
cmd := &cobra.Command{
- Create a ticketCreate a ticket
Function searchChart
has 9 return statements (exceeds 4 allowed). Open
Open
func searchChart(r []*search.Result, release *release.Release, devel bool) (searchResult, bool, error) {
ret := searchResult{}
// trackedRepos keeps information about a repository we already tracked.
type trackedRepos struct {
- Create a ticketCreate a ticket
Function newOutdatedListWriter
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
func newOutdatedListWriter(releases []*release.Release, cfg *action.Configuration, out io.Writer, devel bool) *outdatedListWriter {
var err error
outdated := make([]outdatedElement, 0, len(releases))
dups := make([]repoDuplicate, 0, len(releases))
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function newOutdatedCmd
has 7 return statements (exceeds 4 allowed). Open
Open
func newOutdatedCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
client := action.NewList(cfg)
var outfmt output.Format
cmd := &cobra.Command{
- Create a ticketCreate a ticket
Your code does not pass gofmt in 2 places. Go fmt your code! Open
Open
/*
- Create a ticketCreate a ticket
- Exclude checks
exported const CHART should have comment (or a comment on this block) or be unexported Open
Open
CHART searchType = iota + 1 // CHART search results do contain only one repository which has been found
- Create a ticketCreate a ticket
- Exclude checks
exported var Version should have comment or be unexported Open
Open
Version = "HEAD" // Version identifier
- Create a ticketCreate a ticket
- Exclude checks
2: cannot find package "github.com/Masterminds/semver/v3" in any of: Open
Open
"github.com/Masterminds/semver/v3"
- Create a ticketCreate a ticket
- Exclude checks
BUG found Open
Open
// the repo is tracked if not then we have BUG.
- Create a ticketCreate a ticket
- Exclude checks
TODO found Open
Open
// // TODO(l0nax): refactor me ==> @duplicate append MUST be moved out of this if-block! */
- Create a ticketCreate a ticket
- Exclude checks
TODO found Open
Open
// TODO: implement a better search algorithm. Because this is an linear search algorithm so it takes O(len(r)) steps in the
- Create a ticketCreate a ticket
- Exclude checks