jkawamoto/roadie

View on GitHub

Showing 2,161 of 2,161 total issues

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

func TestConfigRegionSet(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

    Function TestCmdTaskStatus has 55 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestCmdTaskStatus(t *testing.T) {
    
        name, err := createDummyScript(&script.Script{
            Source: "roadie://source/somefile.tar.gz",
        })
    Severity: Minor
    Found in command/queue_test.go - About 1 hr to fix

      Method ComputeNodeUpdateUserParams.WriteToRequest has 55 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

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

        Function TestGetTaskLog has 55 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func TestGetTaskLog(t *testing.T) {
        
            m := NewLogManager()
            now := time.Now()
            queue := "test-queue"
        Severity: Minor
        Found in cloud/mock/log_test.go - About 1 hr to fix

          Function TestConfig has 55 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func TestConfig(t *testing.T) {
          
              var err error
          
              dir, err := ioutil.TempDir("", "config-test")
          Severity: Minor
          Found in config/config_test.go - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            func (s *ComputeService) AvailableRegions(ctx context.Context) (regions []cloud.Region, err error) {
                s.Logger.Println("Retrieving available regions")
                regions, err = Locations(ctx, &s.Config.Token, s.Config.SubscriptionID)
                if err != nil {
                    s.Logger.Println("Cannot retrieve available regions")
            Severity: Major
            Found in cloud/azure/compute.go and 1 other location - About 1 hr to fix
            cloud/azure/instance.go on lines 112..123

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 142.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

            func (m *InstanceManager) AvailableRegions(ctx context.Context) (regions []cloud.Region, err error) {
            
                m.Logger.Println("Retrieving available regions")
                regions, err = Locations(ctx, &m.Config.Token, m.Config.SubscriptionID)
                if err != nil {
            Severity: Major
            Found in cloud/azure/instance.go and 1 other location - About 1 hr to fix
            cloud/azure/compute.go on lines 76..85

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 142.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Method PoolExistsParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
            Open

            func (o *PoolExistsParams) 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_exists_parameters.go - About 1 hr to fix

              Method PoolStopResizeParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
              Open

              func (o *PoolStopResizeParams) 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_stop_resize_parameters.go - About 1 hr to fix

                Method JobDeleteParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                Open

                func (o *JobDeleteParams) 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_delete_parameters.go - About 1 hr to fix

                  Method PoolDeleteParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                  Open

                  func (o *PoolDeleteParams) 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_delete_parameters.go - About 1 hr to fix

                    Method JobEnableParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                    Open

                    func (o *JobEnableParams) 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_enable_parameters.go - About 1 hr to fix

                      Method JobListFromJobScheduleParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                      Open

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

                        Method TaskListParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                        Open

                        func (o *TaskListParams) 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_list_parameters.go - About 1 hr to fix

                          Method FileGetNodeFilePropertiesFromTaskParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                          Open

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

                            Method JobScheduleDisableParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                            Open

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

                              Method JobScheduleExistsParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                              Open

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

                                Method JobScheduleTerminateParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                                Open

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

                                  Method FileListFromTaskParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                                  Open

                                  func (o *FileListFromTaskParams) 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_list_from_task_parameters.go - About 1 hr to fix

                                    Method FileListFromComputeNodeParams.WriteToRequest has 12 return statements (exceeds 4 allowed).
                                    Open

                                    func (o *FileListFromComputeNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
                                    
                                        r.SetTimeout(o.requestTimeout)
                                        var res []error
                                    
                                    
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language