Showing 611 of 2,161 total issues
Method LogManager.Entries
has 5 return statements (exceeds 4 allowed). Open
func (s *LogManager) Entries(ctx context.Context, filter string, handler EntryHandler) (err error) {
s.Logger.Println("Retrieving log:", filter)
var client *logging.Client
Method UsageListParams.WriteToRequest
has 5 return statements (exceeds 4 allowed). Open
func (o *UsageListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.timeout)
var res []error
Method ComputeService.CreateInstance
has 5 return statements (exceeds 4 allowed). Open
func (s *ComputeService) CreateInstance(ctx context.Context, task *script.Script) (err error) {
if task.Image == "" {
task.Image = DefaultBaseImage
}
Method ComputeService.createInstance
has 5 return statements (exceeds 4 allowed). Open
func (s *ComputeService) createInstance(ctx context.Context, instanceName string, matadataItems []*compute.MetadataItems) (err error) {
s.Logger.Println("Creating instance", instanceName)
service, err := s.newService(ctx)
if err != nil {
Function TestQueues
has 5 return statements (exceeds 4 allowed). Open
func TestQueues(t *testing.T) {
var err error
ctx := context.Background()
m := NewQueueManager()
Function TestCreateWorkers
has 5 return statements (exceeds 4 allowed). Open
func TestCreateWorkers(t *testing.T) {
var err error
ctx := context.Background()
m := NewQueueManager()
Function TestLookup
has 5 return statements (exceeds 4 allowed). Open
func TestLookup(t *testing.T) {
// Prepare temporary directory.
temp := filepath.Join(os.TempDir(), "roadie-test", time.Now().Format("20060102150405"), "config")
err := os.MkdirAll(temp, 0744)
Method JobGetAllJobsLifetimeStatisticsParams.WriteToRequest
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (o *JobGetAllJobsLifetimeStatisticsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
- 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 Archive
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func Archive(root string, filename string, excludes []string) (err error) {
writeFile, err := os.OpenFile(filename, os.O_WRONLY|os.O_CREATE, 0600)
if err != nil {
return
- 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 PoolGetAllPoolsLifetimeStatisticsParams.WriteToRequest
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func (o *PoolGetAllPoolsLifetimeStatisticsParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
r.SetTimeout(o.requestTimeout)
var res []error
- 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 TestUpdateSourceSection
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
func TestUpdateSourceSection(t *testing.T) {
var err error
m := testMetadata(nil, nil)
storageManager, err := m.StorageManager()
- 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"