jkawamoto/roadie

View on GitHub

Showing 611 of 2,161 total issues

Method JobScheduleDeleteReader.ReadResponse has 5 return statements (exceeds 4 allowed).
Open

func (o *JobScheduleDeleteReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
    switch response.Code() {

    case 202:
        result := NewJobScheduleDeleteAccepted()
Severity: Major
Found in cloud/azure/batch/client/job_schedules/job_schedule_delete_responses.go - About 35 mins to fix

    Method FileGetNodeFilePropertiesFromTaskReader.ReadResponse has 5 return statements (exceeds 4 allowed).
    Open

    func (o *FileGetNodeFilePropertiesFromTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
        switch response.Code() {
    
        case 200:
            result := NewFileGetNodeFilePropertiesFromTaskOK()

      Method FileListFromTaskReader.ReadResponse has 5 return statements (exceeds 4 allowed).
      Open

      func (o *FileListFromTaskReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
          switch response.Code() {
      
          case 200:
              result := NewFileListFromTaskOK()
      Severity: Major
      Found in cloud/azure/batch/client/files/file_list_from_task_responses.go - About 35 mins to fix

        Method ProvidersListParams.WriteToRequest has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
        Open

        func (o *ProvidersListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
        
            if err := r.SetTimeout(o.timeout); err != nil {
                return err
            }
        Severity: Minor
        Found in cloud/azure/resource/client/providers/providers_list_parameters.go - About 35 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 QueueService.Queues has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
        Open

        func (s *QueueService) Queues(ctx context.Context, handler cloud.QueueStatusHandler) (err error) {
        
            s.Logger.Println("Retrieving queue names")
            statusSet := make(map[string]cloud.QueueStatus)
        
        
        Severity: Minor
        Found in cloud/gcp/queue.go - About 35 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 QueueManager.Workers has 5 return statements (exceeds 4 allowed).
        Open

        func (m *QueueManager) Workers(ctx context.Context, queue string, handler cloud.QueueManagerNameHandler) (err error) {
        
            if m.Failure {
                return ErrServiceFailure
            }
        Severity: Major
        Found in cloud/mock/queue.go - About 35 mins to fix

          Method QueueManager.CreateWorkers has 5 return statements (exceeds 4 allowed).
          Open

          func (m *QueueManager) CreateWorkers(ctx context.Context, queue string, n int, handler cloud.QueueManagerNameHandler) (err error) {
          
              if m.Failure {
                  return ErrServiceFailure
              }
          Severity: Major
          Found in cloud/mock/queue.go - About 35 mins to fix

            Method AvailabilitySetsListParams.WriteToRequest has 5 return statements (exceeds 4 allowed).
            Open

            func (o *AvailabilitySetsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
            
                r.SetTimeout(o.timeout)
                var res []error
            
            

              Method ImagesListByResourceGroupParams.WriteToRequest has 5 return statements (exceeds 4 allowed).
              Open

              func (o *ImagesListByResourceGroupParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
              
                  r.SetTimeout(o.timeout)
                  var res []error
              
              

                Method QueueService.Fetch has 5 return statements (exceeds 4 allowed).
                Open

                func (s *QueueService) Fetch(ctx context.Context, queue string) (task *Task, err error) {
                
                    s.Logger.Println("Retrieving a task in queue", queue)
                    query := datastore.NewQuery(QueueKind).Filter("QueueName=", queue).Filter("Status=", TaskStatusWaiting).Limit(1)
                
                
                Severity: Major
                Found in cloud/gcp/queue.go - About 35 mins to fix

                  Method VirtualMachineScaleSetsListParams.WriteToRequest has 5 return statements (exceeds 4 allowed).
                  Open

                  func (o *VirtualMachineScaleSetsListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                  
                      r.SetTimeout(o.timeout)
                      var res []error
                  
                  

                    Method StorageService.Upload has 5 return statements (exceeds 4 allowed).
                    Open

                    func (s *StorageService) Upload(ctx context.Context, loc *url.URL, in io.Reader) (err error) {
                    
                        s.Logger.Println("Uploading a file to", loc)
                        client, err := s.newClient(ctx)
                        if err != nil {
                    Severity: Major
                    Found in cloud/gcp/storage.go - About 35 mins to fix

                      Method QueueManager.DeleteQueue has 5 return statements (exceeds 4 allowed).
                      Open

                      func (m *QueueManager) DeleteQueue(ctx context.Context, queue string) error {
                      
                          if m.Failure {
                              return ErrServiceFailure
                          }
                      Severity: Major
                      Found in cloud/mock/queue.go - About 35 mins to fix

                        Method VirtualMachineSizesListParams.WriteToRequest has 5 return statements (exceeds 4 allowed).
                        Open

                        func (o *VirtualMachineSizesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                        
                            r.SetTimeout(o.timeout)
                            var res []error
                        
                        

                          Method StorageService.List has 5 return statements (exceeds 4 allowed).
                          Open

                          func (s *StorageService) List(ctx context.Context, loc *url.URL, handler cloud.FileInfoHandler) (err error) {
                          
                              s.Logger.Printf(`Retrieving the list of files matching to prefix "%v"`, loc)
                              client, err := s.newClient(ctx)
                              if err != nil {
                          Severity: Major
                          Found in cloud/gcp/storage.go - About 35 mins to fix

                            Method QueueManager.Restart has 5 return statements (exceeds 4 allowed).
                            Open

                            func (m *QueueManager) Restart(ctx context.Context, queue string) error {
                            
                                if m.Failure {
                                    return ErrServiceFailure
                                }
                            Severity: Major
                            Found in cloud/mock/queue.go - About 35 mins to fix

                              Method StorageService.Download has 5 return statements (exceeds 4 allowed).
                              Open

                              func (s *StorageService) Download(ctx context.Context, loc *url.URL, out io.Writer) (err error) {
                              
                                  s.Logger.Println("Downloading a file from", loc)
                                  client, err := s.newClient(ctx)
                                  if err != nil {
                              Severity: Major
                              Found in cloud/gcp/storage.go - About 35 mins to fix

                                Method VirtualMachinesListParams.WriteToRequest has 5 return statements (exceeds 4 allowed).
                                Open

                                func (o *VirtualMachinesListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                                
                                    r.SetTimeout(o.timeout)
                                    var res []error
                                
                                

                                  Method VirtualMachineImagesListPublishersParams.WriteToRequest has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (o *VirtualMachineImagesListPublishersParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                                  
                                      r.SetTimeout(o.timeout)
                                      var res []error
                                  
                                  

                                    Method QueueManager.DeleteTask has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (m *QueueManager) DeleteTask(ctx context.Context, queue, task string) error {
                                    
                                        if m.Failure {
                                            return ErrServiceFailure
                                        }
                                    Severity: Major
                                    Found in cloud/mock/queue.go - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language