jkawamoto/roadie

View on GitHub

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
Severity: Major
Found in cloud/gcp/log_manager.go - About 35 mins to fix

    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
    
    
    Severity: Major
    Found in cloud/azure/compute/client/usage/usage_list_parameters.go - About 35 mins to fix

      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
          }
      Severity: Major
      Found in cloud/gcp/instance.go - About 35 mins to fix

        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 {
        Severity: Major
        Found in cloud/gcp/instance.go - About 35 mins to fix

          Function TestQueues has 5 return statements (exceeds 4 allowed).
          Open

          func TestQueues(t *testing.T) {
          
              var err error
              ctx := context.Background()
              m := NewQueueManager()
          Severity: Major
          Found in cloud/mock/queue_test.go - About 35 mins to fix

            Function TestCreateWorkers has 5 return statements (exceeds 4 allowed).
            Open

            func TestCreateWorkers(t *testing.T) {
            
                var err error
                ctx := context.Background()
                m := NewQueueManager()
            Severity: Major
            Found in cloud/mock/queue_test.go - About 35 mins to fix

              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)
              Severity: Major
              Found in config/config_test.go - About 35 mins to fix

                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
                
                

                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
                Severity: Minor
                Found in command/util/archive.go - About 25 mins to fix

                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
                
                

                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()
                Severity: Minor
                Found in command/helper_test.go - About 25 mins to fix

                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

                Severity
                Category
                Status
                Source
                Language