Showing 26 of 144 total issues
Method Formatter.Format
has a Cognitive Complexity of 42 (exceeds 20 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
report, err := formatters.NewReport()
if err != nil {
return report, err
}
- Read upRead up
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
Method Formatter.Format
has a Cognitive Complexity of 37 (exceeds 20 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
- Read upRead up
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
Method Formatter.Format
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
report, err := formatters.NewReport()
if err != nil {
return report, err
}
- Read upRead up
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
Method Formatter.Format
has 59 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
Method Formatter.Format
has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
sourcePaths := getSourcePaths()
rep, err := formatters.NewReport()
if err != nil {
- Read upRead up
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
Method Formatter.Format
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
report, err := formatters.NewReport()
if err != nil {
return report, err
}
Method region.UnmarshalJSON
has 10 return statements (exceeds 4 allowed). Open
func (region *region) UnmarshalJSON(data []byte) error {
var array []interface{}
if err := json.Unmarshal(data, &array); err != nil {
return err
}
Method Formatter.Format
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
- Read upRead up
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
Method Uploader.doRequest
has 7 return statements (exceeds 4 allowed). Open
func (u Uploader) doRequest(in io.Reader, url string) (*http.Response, error) {
c := http.Client{
Transport: u.newTransport(),
Timeout: 30 * time.Second,
}
Method segment.UnmarshalJSON
has 7 return statements (exceeds 4 allowed). Open
func (segment *segment) UnmarshalJSON(data []byte) error {
var array []interface{}
if err := json.Unmarshal(data, &array); err != nil {
return err
}
Method Uploader.Upload
has 7 return statements (exceeds 4 allowed). Open
func (u Uploader) Upload() error {
if u.ReporterID == "" {
return errors.New("you must supply a CC_TEST_REPORTER_ID ENV variable or pass it via the -r flag")
}
Method Formatter.Format
has 7 return statements (exceeds 4 allowed). Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
Method Formatter.Format
has 6 return statements (exceeds 4 allowed). Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
Method Formatter.Format
has 6 return statements (exceeds 4 allowed). Open
func (r *Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
Method Formatter.Format
has 6 return statements (exceeds 4 allowed). Open
func (r Formatter) Format() (formatters.Report, error) {
report, err := formatters.NewReport()
if err != nil {
return report, err
}
Function jsonFormat
has 6 return statements (exceeds 4 allowed). Open
func jsonFormat(r Formatter, rep formatters.Report) (formatters.Report, error) {
logrus.Debugf("Analyzing simplecov json output from latest format %s", r.Path)
jf, err := os.Open(r.Path)
if err != nil {
return rep, errors.WithStack(errors.Errorf("could not open coverage file %s", r.Path))
Method Formatter.Format
has 6 return statements (exceeds 4 allowed). Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}
Function findGitInfo
has 5 return statements (exceeds 4 allowed). Open
func findGitInfo() (Git, error) {
g := Git{}
var err error
g.Branch = findVar(gitBranchVars)
Function parseSourceFile
has 5 return statements (exceeds 4 allowed). Open
func parseSourceFile(fileName string, gitHead *object.Commit) (formatters.SourceFile, error) {
var sf formatters.SourceFile
sourceFileName, err := getSourceFileName(fileName)
if err != nil {
return sf, errors.WithStack(err)
Method Formatter.Format
has 5 return statements (exceeds 4 allowed). Open
func (r Formatter) Format() (formatters.Report, error) {
rep, err := formatters.NewReport()
if err != nil {
return rep, err
}