jkawamoto/roadie

View on GitHub

Showing 611 of 2,161 total issues

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

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

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

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

Severity: Minor
Found in cloud/azure/batch/client/files/file_list_from_task_parameters.go - About 4 hrs 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

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

func TestLogManagerGet(t *testing.T) {

    now := time.Now()

    m := NewLogManager()
Severity: Major
Found in cloud/mock/log_test.go - About 4 hrs to fix

    Function TestCmdInit has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestCmdInit(t *testing.T) {
    
        var err error
        var output bytes.Buffer
        m := testMetadata(&output, nil)
    Severity: Minor
    Found in command/init_test.go - About 4 hrs 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 ComputeNodeListParams.WriteToRequest has a Cognitive Complexity of 46 (exceeds 20 allowed). Consider refactoring.
    Open

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

    func (o *JobListPreparationAndReleaseTaskStatusParams) 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 TestArchive has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestArchive(t *testing.T) {
    
        var err error
        root := ".."
    
    
    Severity: Minor
    Found in command/util/archive_test.go - About 4 hrs 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 CertificateListParams.WriteToRequest has a Cognitive Complexity of 45 (exceeds 20 allowed). Consider refactoring.
    Open

    func (o *CertificateListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
    
        r.SetTimeout(o.requestTimeout)
        var res []error
    
    
    Severity: Minor
    Found in cloud/azure/batch/client/certificates/certificate_list_parameters.go - About 4 hrs 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

    Function TestCmdTaskLog has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestCmdTaskLog(t *testing.T) {
    
        var stdout bytes.Buffer
        var stderr bytes.Buffer
        p := mock.NewProvider()
    Severity: Minor
    Found in command/queue_test.go - About 4 hrs 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

    Function TestCmdQueueLog has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestCmdQueueLog(t *testing.T) {
    
        var stdout bytes.Buffer
        var stderr bytes.Buffer
        p := mock.NewProvider()
    Severity: Minor
    Found in command/queue_test.go - About 4 hrs 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

    Function TestUploadSourceFiles has a Cognitive Complexity of 44 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestUploadSourceFiles(t *testing.T) {
    
        var err error
        m := testMetadata(nil, nil)
        s, err := m.StorageManager()
    Severity: Minor
    Found in command/source_test.go - About 4 hrs 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 mockStorageAccountServer.ServeHTTP has a Cognitive Complexity of 43 (exceeds 20 allowed). Consider refactoring.
    Open

    func (m *mockStorageAccountServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
    
        paths := strings.Split(strings.TrimPrefix(req.URL.Path, "/"), "/")
        if len(paths) < 2 {
            res.WriteHeader(http.StatusBadRequest)
    Severity: Minor
    Found in cloud/azure/storage_test.go - About 4 hrs 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

    Function TestPrintDirList has a Cognitive Complexity of 42 (exceeds 20 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 3 hrs 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

    TaskGetParams has 31 methods (exceeds 20 allowed). Consider refactoring.
    Open

    type TaskGetParams struct {
    
        /*NrDollarExpand
          An OData $expand clause.
    
    
    Severity: Minor
    Found in cloud/azure/batch/client/tasks/task_get_parameters.go - About 3 hrs to fix

      File commands.go has 573 lines of code (exceeds 500 allowed). Consider refactoring.
      Open

      //
      // commands.go
      //
      // Copyright (c) 2016-2017 Junpei Kawamoto
      //
      Severity: Minor
      Found in commands.go - About 3 hrs to fix

        Function TestCmdInit has 117 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func TestCmdInit(t *testing.T) {
        
            var err error
            var output bytes.Buffer
            m := testMetadata(&output, nil)
        Severity: Major
        Found in command/init_test.go - About 3 hrs to fix

          Method BatchService.CreateJob has 117 lines of code (exceeds 50 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: Major
          Found in cloud/azure/batch.go - About 3 hrs to fix

            Function TestLogManagerGet has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring.
            Open

            func TestLogManagerGet(t *testing.T) {
            
                now := time.Now()
            
                m := NewLogManager()
            Severity: Minor
            Found in cloud/mock/log_test.go - About 3 hrs 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

            PoolGetParams has 29 methods (exceeds 20 allowed). Consider refactoring.
            Open

            type PoolGetParams struct {
            
                /*NrDollarExpand
                  An OData $expand clause.
            
            
            Severity: Minor
            Found in cloud/azure/batch/client/pools/pool_get_parameters.go - About 3 hrs to fix

              JobGetParams has 29 methods (exceeds 20 allowed). Consider refactoring.
              Open

              type JobGetParams struct {
              
                  /*NrDollarExpand
                    An OData $expand clause.
              
              
              Severity: Minor
              Found in cloud/azure/batch/client/jobs/job_get_parameters.go - About 3 hrs to fix
                Severity
                Category
                Status
                Source
                Language