NeverBounce/NeverBounceCli-Ruby

View on GitHub

Showing 24 of 24 total issues

Method has too many lines. [70/30]
Open

    def slim_main
      "Response".tap do |label|
        headings = [
          ["nPages", :total_pages, :right],
          ["nResults", :total_results, :right],

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [52/30]
Open

    def slim_main
      "Response".tap do |label|
        headings = [
          ["Result", :result, :center],
          [

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [48/30]
Open

    def slim_main
      "Response".tap do |label|
        headings = [
          ["nPages", :total_pages, :right],
          ["nResults", :total_results, :right],

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method has too many lines. [46/30]
Open

    def slim_main
      "Response".tap do |label|
        headings = [
          ["ID", :id, :right],

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

module NeverBounce; module CLI; module Script
  class JobsParse < RequestMaker
    Script::Feature::RequiresJobId.load(self)

    attr_writer :auto_start
Severity: Major
Found in lib/never_bounce/cli/script/jobs_parse.rb and 1 other location - About 3 hrs to fix
lib/never_bounce/cli/script/jobs_start.rb on lines 8..70

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

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

module NeverBounce; module CLI; module Script
  class JobsStart < RequestMaker
    Script::Feature::RequiresJobId.load(self)

    attr_writer :run_sample
Severity: Major
Found in lib/never_bounce/cli/script/jobs_start.rb and 1 other location - About 3 hrs to fix
lib/never_bounce/cli/script/jobs_parse.rb on lines 8..70

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

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 has too many lines. [41/30]
Open

    def slim_main
      "Response".tap do |label|
        headings = [
          ["ExecTime", :execution_time, :right],
        ]

This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

Method slim_main has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def slim_main
      "Response".tap do |label|
        headings = [
          ["nPages", :total_pages, :right],
          ["nResults", :total_results, :right],
Severity: Major
Found in lib/never_bounce/cli/script/jobs_search.rb - About 2 hrs to fix

    Method slim_main has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def slim_main
          "Response".tap do |label|
            headings = [
              ["Result", :result, :center],
              [
    Severity: Major
    Found in lib/never_bounce/cli/script/single_check.rb - About 2 hrs to fix

      Method slim_main has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def slim_main
            "Response".tap do |label|
              headings = [
                ["nPages", :total_pages, :right],
                ["nResults", :total_results, :right],
      Severity: Minor
      Found in lib/never_bounce/cli/script/jobs_results.rb - About 1 hr to fix

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

              "Credits".tap do |label|
                headings = [
                  ["FreeRmn", :free_credits_remaining, :right],
                  ["FreeUsed", :free_credits_used, :right],
                  (["MonthlyUsage", :monthly_api_usage, :right] if response.credits_info.monthly?),
        Severity: Major
        Found in lib/never_bounce/cli/script/account_info.rb and 1 other location - About 1 hr to fix
        lib/never_bounce/cli/script/single_check.rb on lines 125..140

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

        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

              response.credits_info? and "CreditsInfo".tap do |label|
                headings = [
                  ["FreeRmn", :free_credits_remaining, :right],
                  ["FreeUsed", :free_credits_used, :right],
                  (["MonthlyUsage", :monthly_api_usage, :right] if response.credits_info.monthly?),
        Severity: Major
        Found in lib/never_bounce/cli/script/single_check.rb and 1 other location - About 1 hr to fix
        lib/never_bounce/cli/script/account_info.rb on lines 47..62

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

        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 slim_main has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def slim_main
              "Response".tap do |label|
                headings = [
                  ["ID", :id, :right],
        
        
        Severity: Minor
        Found in lib/never_bounce/cli/script/jobs_status.rb - About 1 hr to fix

          Method slim_main has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              def slim_main
                "Response".tap do |label|
                  headings = [
                    ["ExecTime", :execution_time, :right],
                  ]
          Severity: Minor
          Found in lib/never_bounce/cli/script/account_info.rb - About 1 hr to fix

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

                  "Response".tap do |label|
                    headings = [
                      ["nPages", :total_pages, :right],
                      ["nResults", :total_results, :right],
            
            
            Severity: Major
            Found in lib/never_bounce/cli/script/jobs_search.rb and 1 other location - About 1 hr to fix
            lib/never_bounce/cli/script/jobs_results.rb on lines 42..56

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

            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

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

                  "Response".tap do |label|
                    headings = [
                      ["nPages", :total_pages, :right],
                      ["nResults", :total_results, :right],
            
            
            Severity: Major
            Found in lib/never_bounce/cli/script/jobs_results.rb and 1 other location - About 1 hr to fix
            lib/never_bounce/cli/script/jobs_search.rb on lines 51..65

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

            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

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

                  "Response".tap do |label|
                    headings = [
                      ["ExecTime", :execution_time, :right],
                    ]
            
            
            Severity: Minor
            Found in lib/never_bounce/cli/script/account_info.rb and 1 other location - About 50 mins to fix
            lib/never_bounce/cli/script/jobs_delete.rb on lines 38..49

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

            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

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

                  "Response".tap do |label|
                    headings = [
                      ["ExecTime", :execution_time, :right],
                    ]
            
            
            Severity: Minor
            Found in lib/never_bounce/cli/script/jobs_delete.rb and 1 other location - About 50 mins to fix
            lib/never_bounce/cli/script/account_info.rb on lines 33..44

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

            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 process has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def process(input)
                  values, default = [], nil
            
                  input.each do |elem|
                    if elem.is_a? Hash
            Severity: Minor
            Found in lib/never_bounce/cli/feature/envars/examples_mapper.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 slim_main has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                def slim_main
                  "Response".tap do |label|
                    headings = [
                      ["Result", :result, :center],
                      [
            Severity: Minor
            Found in lib/never_bounce/cli/script/single_check.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