jkawamoto/roadie

View on GitHub

Showing 611 of 2,161 total issues

Function TestStorageService has a Cognitive Complexity of 82 (exceeds 20 allowed). Consider refactoring.
Open

func TestStorageService(t *testing.T) {

    var err error
    server := mock.NewStorageServer()
    defer server.Close()
Severity: Minor
Found in cloud/azure/storage_test.go - About 1 day 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 StorageServer.ServeHTTP has a Cognitive Complexity of 81 (exceeds 20 allowed). Consider refactoring.
Open

func (s *StorageServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {

    var container, filename string
    if sp := strings.SplitN(strings.TrimPrefix(req.URL.Path, "/"), "/", 2); len(sp) == 1 {
        container = sp[0]
Severity: Minor
Found in cloud/azure/mock/storage.go - About 1 day 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 TestStorageService has 209 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func TestStorageService(t *testing.T) {

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

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

    func (o *TaskListParams) 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_list_parameters.go - About 5 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 JobListFromJobScheduleParams.WriteToRequest has a Cognitive Complexity of 54 (exceeds 20 allowed). Consider refactoring.
    Open

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

    File batch.go has 661 lines of code (exceeds 500 allowed). Consider refactoring.
    Open

    //
    // cloud/azure/batch.go
    //
    // Copyright (c) 2016-2017 Junpei Kawamoto
    //
    Severity: Minor
    Found in cloud/azure/batch.go - About 5 hrs to fix

      Method StorageServer.ServeHTTP has 170 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func (s *StorageServer) ServeHTTP(res http.ResponseWriter, req *http.Request) {
      
          var container, filename string
          if sp := strings.SplitN(strings.TrimPrefix(req.URL.Path, "/"), "/", 2); len(sp) == 1 {
              container = sp[0]
      Severity: Major
      Found in cloud/azure/mock/storage.go - About 5 hrs to fix

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

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

        func (o *PoolListParams) 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_list_parameters.go - About 5 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 JobListParams.WriteToRequest has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
        Open

        func (o *JobListParams) 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_list_parameters.go - About 5 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 JobScheduleListParams.WriteToRequest has a Cognitive Complexity of 53 (exceeds 20 allowed). Consider refactoring.
        Open

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

        func TestPrintFileList(t *testing.T) {
        
            var err error
            var output bytes.Buffer
            files := []string{
        Severity: Minor
        Found in command/table_test.go - About 5 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

        File queue_test.go has 649 lines of code (exceeds 500 allowed). Consider refactoring.
        Open

        //
        // cloud/mock/queue_test.go
        //
        // Copyright (c) 2016-2017 Junpei Kawamoto
        //
        Severity: Minor
        Found in cloud/mock/queue_test.go - About 5 hrs to fix

          Function TestCmdLog has 164 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func TestCmdLog(t *testing.T) {
          
              var err error
              var stdout bytes.Buffer
              var stderr bytes.Buffer
          Severity: Major
          Found in command/log_test.go - About 5 hrs to fix

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

            func (o *TaskGetParams) 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_get_parameters.go - About 5 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

            File queue_test.go has 641 lines of code (exceeds 500 allowed). Consider refactoring.
            Open

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

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

              func (o *JobGetParams) 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_get_parameters.go - About 5 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 PoolGetParams.WriteToRequest has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
              Open

              func (o *PoolGetParams) 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_get_parameters.go - About 5 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 JobScheduleGetParams.WriteToRequest has a Cognitive Complexity of 50 (exceeds 20 allowed). Consider refactoring.
              Open

              func (o *JobScheduleGetParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
              
                  r.SetTimeout(o.requestTimeout)
                  var res []error
              
              
              Severity: Minor
              Found in cloud/azure/batch/client/job_schedules/job_schedule_get_parameters.go - About 5 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 TestCmdLog has a Cognitive Complexity of 47 (exceeds 20 allowed). Consider refactoring.
              Open

              func TestCmdLog(t *testing.T) {
              
                  var err error
                  var stdout bytes.Buffer
                  var stderr bytes.Buffer
              Severity: Minor
              Found in command/log_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

              Severity
              Category
              Status
              Source
              Language