jkawamoto/roadie

View on GitHub

Showing 2,161 of 2,161 total issues

Method PoolPatchParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
Open

func (o *PoolPatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {

    r.SetTimeout(o.requestTimeout)
    var res []error

Severity: Major
Found in cloud/azure/batch/client/pools/pool_patch_parameters.go - About 1 hr to fix

    Method JobUpdateParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
    Open

    func (o *JobUpdateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        r.SetTimeout(o.requestTimeout)
        var res []error
    
    
    Severity: Major
    Found in cloud/azure/batch/client/jobs/job_update_parameters.go - About 1 hr to fix

      Method PoolEnableAutoScaleParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
      Open

      func (o *PoolEnableAutoScaleParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
      
          r.SetTimeout(o.requestTimeout)
          var res []error
      
      
      Severity: Major
      Found in cloud/azure/batch/client/pools/pool_enable_auto_scale_parameters.go - About 1 hr to fix

        Method PoolResizeParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
        Open

        func (o *PoolResizeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
        
            r.SetTimeout(o.requestTimeout)
            var res []error
        
        
        Severity: Major
        Found in cloud/azure/batch/client/pools/pool_resize_parameters.go - About 1 hr to fix

          Method PoolRemoveNodesParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
          Open

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

            Method TaskReactivateParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
            Open

            func (o *TaskReactivateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
            
                r.SetTimeout(o.requestTimeout)
                var res []error
            
            
            Severity: Major
            Found in cloud/azure/batch/client/tasks/task_reactivate_parameters.go - About 1 hr to fix

              Method TaskTerminateParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
              Open

              func (o *TaskTerminateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
              
                  r.SetTimeout(o.requestTimeout)
                  var res []error
              
              
              Severity: Major
              Found in cloud/azure/batch/client/tasks/task_terminate_parameters.go - About 1 hr to fix

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

                func (o *ComputeNodeUpdateUserParams) 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

                Method TaskDeleteParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                Open

                func (o *TaskDeleteParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                
                    r.SetTimeout(o.requestTimeout)
                    var res []error
                
                
                Severity: Major
                Found in cloud/azure/batch/client/tasks/task_delete_parameters.go - About 1 hr to fix

                  Method JobDisableParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                  Open

                  func (o *JobDisableParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                  
                      r.SetTimeout(o.requestTimeout)
                      var res []error
                  
                  
                  Severity: Major
                  Found in cloud/azure/batch/client/jobs/job_disable_parameters.go - About 1 hr to fix

                    Method JobTerminateParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                    Open

                    func (o *JobTerminateParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                    
                        r.SetTimeout(o.requestTimeout)
                        var res []error
                    
                    
                    Severity: Major
                    Found in cloud/azure/batch/client/jobs/job_terminate_parameters.go - About 1 hr to fix

                      Method JobPatchParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                      Open

                      func (o *JobPatchParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                      
                          r.SetTimeout(o.requestTimeout)
                          var res []error
                      
                      
                      Severity: Major
                      Found in cloud/azure/batch/client/jobs/job_patch_parameters.go - About 1 hr to fix

                        Method JobSchedulePatchParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                        Open

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

                          Method FileGetFromTaskParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                          Open

                          func (o *FileGetFromTaskParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                          
                              r.SetTimeout(o.requestTimeout)
                              var res []error
                          
                          
                          Severity: Major
                          Found in cloud/azure/batch/client/files/file_get_from_task_parameters.go - About 1 hr to fix

                            Method FileGetFromComputeNodeParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                            Open

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

                              Method JobScheduleUpdateParams.WriteToRequest has 13 return statements (exceeds 4 allowed).
                              Open

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

                                Method BatchService.CreateJob has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                                Open

                                func (s *BatchService) CreateJob(ctx context.Context, name string) (err error) {
                                
                                    // 1. Check metadata, if error returns, it means no app exists, then upload.
                                    // 2. If version metadata is old or snapshot, upload new version.
                                    // 3. otherwise create url and use it.
                                Severity: Minor
                                Found in cloud/azure/batch.go - About 1 hr 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 mockBatchAcountServer.ServeHTTP has 13 return statements (exceeds 4 allowed).
                                Open

                                func (m *mockBatchAcountServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
                                
                                    paths := strings.Split(strings.TrimPrefix(req.URL.Path, "/"), "/")
                                    if len(paths) < 2 {
                                        res.WriteHeader(http.StatusBadRequest)
                                Severity: Major
                                Found in cloud/azure/batch_account_test.go - About 1 hr to fix

                                  Method optDataPut.run has 56 lines of code (exceeds 50 allowed). Consider refactoring.
                                  Open

                                  func (o *optDataPut) run() (err error) {
                                  
                                      filenames, err := filepath.Glob(o.Filename)
                                      if err != nil {
                                          return
                                  Severity: Minor
                                  Found in command/data.go - About 1 hr to fix

                                    Function TestConfigMachineTypeSet has 56 lines of code (exceeds 50 allowed). Consider refactoring.
                                    Open

                                    func TestConfigMachineTypeSet(t *testing.T) {
                                    
                                        var err error
                                        var output bytes.Buffer
                                        p := mock.NewProvider()
                                    Severity: Minor
                                    Found in command/config_test.go - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language