Showing 146 of 546 total issues
File gtfs-realtime.pb.go
has 2670 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright 2015 The GTFS Specifications 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
Method SituationAlertCause.FromString
has a Cognitive Complexity of 225 (exceeds 20 allowed). Consider refactoring. Open
func (alertCause *SituationAlertCause) FromString(s string) error {
switch SituationAlertCause(s) {
case SituationAlertCauseAccident:
fallthrough
case SituationAlertCauseAirraid:
- 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
File situation_attributes.go
has 1145 lines of code (exceeds 500 allowed). Consider refactoring. Open
package model
import (
"errors"
"fmt"
Method SituationAlertCause.FromString
has 455 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (alertCause *SituationAlertCause) FromString(s string) error {
switch SituationAlertCause(s) {
case SituationAlertCauseAccident:
fallthrough
case SituationAlertCauseAirraid:
PartnerSettings
has 90 methods (exceeds 20 allowed). Consider refactoring. Open
type PartnerSettings struct {
idgen.IdentifierGenerator
ug func() uuid.UUIDGenerator
Function file_gtfs_realtime_proto_init
has 318 lines of code (exceeds 50 allowed). Consider refactoring. Open
func file_gtfs_realtime_proto_init() {
if File_gtfs_realtime_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
File partner.go
has 823 lines of code (exceeds 500 allowed). Consider refactoring. Open
package core
import (
"encoding/json"
"errors"
File situation.go
has 789 lines of code (exceeds 500 allowed). Consider refactoring. Open
package model
import (
"encoding/json"
"errors"
Partner
has 59 methods (exceeds 20 allowed). Consider refactoring. Open
type Partner struct {
uuid.UUIDConsumer
*s.PartnerSettings
mutex *sync.RWMutex
Method ETTBroadcaster.prepareSIRIEstimatedTimetable
has a Cognitive Complexity of 67 (exceeds 20 allowed). Consider refactoring. Open
func (ett *ETTBroadcaster) prepareSIRIEstimatedTimetable() {
ett.connector.mutex.Lock()
events := ett.connector.toBroadcast
ett.connector.toBroadcast = make(map[SubscriptionId][]model.StopVisitId)
- 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
File situation_exchange_reponse.go
has 749 lines of code (exceeds 500 allowed). Consider refactoring. Open
package sxml
import (
"fmt"
"strings"
XMLMonitoredVehicleJourney
has 55 methods (exceeds 20 allowed). Consider refactoring. Open
type XMLMonitoredVehicleJourney struct {
XMLCall
datedVehicleJourneyRef string
lineRef string
Function file_gtfs_realtime_proto_init
has a Cognitive Complexity of 65 (exceeds 20 allowed). Consider refactoring. Open
func file_gtfs_realtime_proto_init() {
if File_gtfs_realtime_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
- 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 SIRIEstimatedTimetableRequestBroadcaster.getEstimatedTimetableDelivery
has a Cognitive Complexity of 61 (exceeds 20 allowed). Consider refactoring. Open
func (connector *SIRIEstimatedTimetableRequestBroadcaster) getEstimatedTimetableDelivery(request *sxml.XMLEstimatedTimetableRequest) siri.SIRIEstimatedTimetableDelivery {
currentTime := connector.Clock().Now()
delivery := siri.SIRIEstimatedTimetableDelivery{
RequestMessageRef: request.MessageIdentifier(),
- 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
Function main
has 180 lines of code (exceeds 50 allowed). Consider refactoring. Open
func main() {
cpuProfile := flag.String("cpuprofile", "", "Write cpu profile to file")
memProfile := flag.String("memprofile", "", "Write memory profile to this file")
uuidPtr := flag.Bool("testuuid", false, "Use the test uuid generator")
File partner_settings.go
has 672 lines of code (exceeds 500 allowed). Consider refactoring. Open
package settings
import (
"fmt"
"regexp"
Function deepValueEqual
has a Cognitive Complexity of 55 (exceeds 20 allowed). Consider refactoring. Open
func deepValueEqual(v1, v2 reflect.Value, visited map[visit]bool) bool {
if !v1.IsValid() || !v2.IsValid() {
return v1.IsValid() == v2.IsValid()
}
if v1.Type() != v2.Type() {
- 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 VMBroadcaster.prepareSIRIVehicleMonitoring
has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring. Open
func (vm *VMBroadcaster) prepareSIRIVehicleMonitoring() {
vm.connector.mutex.Lock()
defer vm.connector.mutex.Unlock()
events := vm.connector.toBroadcast
- 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 SituationCondition.FromString
has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring. Open
func (condition *SituationCondition) FromString(c string) error {
switch SituationCondition(c) {
case SituationConditionAdditionalRide:
fallthrough
case SituationConditionAdditionalService:
- 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 PTTBroadcaster.prepareSIRIProductionTimetable
has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring. Open
func (ptt *PTTBroadcaster) prepareSIRIProductionTimetable() {
ptt.connector.mutex.Lock()
events := ptt.connector.toBroadcast
ptt.connector.toBroadcast = make(map[SubscriptionId][]model.StopVisitId)
- 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"