pmint93/holistics-cli

View on GitHub

Showing 12 of 16 total issues

Method list has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    def list
      puts "`imports list` called with options: #{options}" if Holistics.debug?
      tp(
        @this.all.map do |item|
          source =  case item['source_type']
Severity: Minor
Found in lib/holistics/imports.rb - 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 info has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def info(id)
      puts "`imports info #{id}` called with options: #{options}" if Holistics.debug?
      item = @this.find(id)
      # General info
      {
Severity: Minor
Found in lib/holistics/imports.rb - About 1 hr to fix

    Method info has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def info(id)
          puts "`transform info #{id}` called with options: #{options}" if Holistics.debug?
          item = @this.find(id)
          # General info
          {
    Severity: Minor
    Found in lib/holistics/transforms.rb - About 1 hr to fix

      Method list has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def list
            puts "`imports list` called with options: #{options}" if Holistics.debug?
            tp(
              @this.all.map do |item|
                source =  case item['source_type']
      Severity: Minor
      Found in lib/holistics/imports.rb - About 1 hr to fix

        Method logs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def logs(id)
              puts "`jobs logs #{id}` called with options: #{options}" if Holistics.debug?
              if options[:follow]
                last_id = 0
                loop do
        Severity: Minor
        Found in lib/holistics/jobs.rb - 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 config has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
        Open

            def config(token = nil)
              unless token
                current_config = configured? ? read_config : {}
                current_token = current_config[:token]
                new_token = ask "Your Holistics token [#{current_token.to_s.light_black}]: "
        Severity: Minor
        Found in lib/holistics.rb - 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 info has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def info(id)
              puts "`jobs info #{id}` called with options: #{options}" if Holistics.debug?
              item = @this.find(id)
              {
                id: item['id'].to_s.yellow,
        Severity: Minor
        Found in lib/holistics/jobs.rb - 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 cancel has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def cancel(id)
              puts "`jobs cancel #{id}` called with options: #{options}" if Holistics.debug?
              print "Cancelling Job #{id} ...".yellow
              result = @this.cancel(id)
              if result['status'].to_s.upcase == 'OK'
        Severity: Minor
        Found in lib/holistics/jobs.rb - About 45 mins 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 list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def list(ds_id = nil)
              puts "`transforms list` called with options: #{options}" if Holistics.debug?
              tp(
                @this.all.map do |item|
                  item.slice(*%w{id title owner_name}).merge({
        Severity: Minor
        Found in lib/holistics/transforms.rb - About 35 mins 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 list has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def list
              puts "`jobs list` called with options: #{options}" if Holistics.debug?
              tp(
                @this.all(options).map do |item|
                  {
        Severity: Minor
        Found in lib/holistics/jobs.rb - About 35 mins 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 info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def info(id)
              puts "`transform info #{id}` called with options: #{options}" if Holistics.debug?
              item = @this.find(id)
              # General info
              {
        Severity: Minor
        Found in lib/holistics/transforms.rb - About 35 mins 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 info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def info(id)
              puts "`imports info #{id}` called with options: #{options}" if Holistics.debug?
              item = @this.find(id)
              # General info
              {
        Severity: Minor
        Found in lib/holistics/imports.rb - About 35 mins 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