jkawamoto/roadie

View on GitHub

Showing 2,161 of 2,161 total issues

Function TestLogManagerGet has 76 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func TestLogManagerGet(t *testing.T) {

    var err error
    server := mock.NewStorageServer()
    defer server.Close()
Severity: Major
Found in cloud/azure/log_manager_test.go - About 2 hrs to fix

    Function TestWorkers has 74 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func TestWorkers(t *testing.T) {
    
        var err error
        ctx := context.Background()
        m := NewQueueManager()
    Severity: Minor
    Found in cloud/mock/queue_test.go - About 1 hr to fix

      Function TestUpdateSourceSection has 73 lines of code (exceeds 50 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 1 hr to fix

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

        func (o *FileGetNodeFilePropertiesFromComputeNodeParams) 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 FileGetNodeFilePropertiesFromTaskParams.WriteToRequest has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        func (o *FileGetNodeFilePropertiesFromTaskParams) 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 ResourcesListParams.WriteToRequest has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        func (o *ResourcesListParams) 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/resources/resources_list_parameters.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 LogManager.get has a Cognitive Complexity of 30 (exceeds 20 allowed). Consider refactoring.
        Open

        func (m *LogManager) get(ctx context.Context, urls []*url.URL, handler cloud.LogHandler) (err error) {
        
            ch := make(chan string)
            wg, ctx := errgroup.WithContext(ctx)
            reader, writer := io.Pipe()
        Severity: Minor
        Found in cloud/azure/log_manager.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

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

        func (s *BatchService) GetPoolInfo(ctx context.Context, name string) (info *models.CloudPool, err error) {
        
            s.Logger.Println("Retrieving information of pool", name)
            res, err := s.client.Pools.PoolGet(
                pools.NewPoolGetParamsWithContext(ctx).
        Severity: Major
        Found in cloud/azure/batch.go and 1 other location - About 1 hr to fix
        cloud/azure/batch.go on lines 650..667

        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 183.

        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 (s *BatchService) GetJobInfo(ctx context.Context, job string) (info *models.CloudJob, err error) {
        
            s.Logger.Println("Retrieving information of job", job)
            res, err := s.client.Jobs.JobGet(
                jobs.NewJobGetParamsWithContext(ctx).
        Severity: Major
        Found in cloud/azure/batch.go and 1 other location - About 1 hr to fix
        cloud/azure/batch.go on lines 326..343

        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 183.

        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

        Function TestPrintDirList has 72 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func TestPrintDirList(t *testing.T) {
        
            var err error
            var output bytes.Buffer
            files := []string{
        Severity: Minor
        Found in command/table_test.go - About 1 hr to fix

          Method TaskUpdateParams.WriteToRequest has 72 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

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

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

                t.Run("source option", func(t *testing.T) {
                    s := testScript
                    opt := SourceOpt{
                        Source: "somefile",
                    }
            Severity: Major
            Found in command/helper_test.go and 1 other location - About 1 hr to fix
            command/helper_test.go on lines 408..425

            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 180.

            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

                t.Run("local option", func(t *testing.T) {
                    s := testScript
                    opt := SourceOpt{
                        Local: "util",
                    }
            Severity: Major
            Found in command/helper_test.go and 1 other location - About 1 hr to fix
            command/helper_test.go on lines 427..444

            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 180.

            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 PoolUpgradeOSParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

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

              Method PoolPatchParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
              Open

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

                Method JobUpdateParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
                Open

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

                  Method PoolResizeParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
                  Open

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

                    Method PoolEnableAutoScaleParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
                    Open

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

                      Method JobTerminateParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
                      Open

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

                        Method JobDisableParams.WriteToRequest has 69 lines of code (exceeds 50 allowed). Consider refactoring.
                        Open

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