hiptest/hiptest-publisher

View on GitHub
lib/hiptest-publisher/handlebars_helper.rb

Summary

Maintainability
C
1 day
Test Coverage

Class HandlebarsHelper has 43 methods (exceeds 20 allowed). Consider refactoring.
Open

  class HandlebarsHelper
    def self.register_helpers(handlebars, context)
      instance = Hiptest::HandlebarsHelper.new(handlebars, context)
      instance.register_string_helpers
      instance.register_custom_helpers
Severity: Minor
Found in lib/hiptest-publisher/handlebars_helper.rb - About 5 hrs to fix

    File handlebars_helper.rb has 257 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    module Hiptest
      class HandlebarsHelper
        def self.register_helpers(handlebars, context)
          instance = Hiptest::HandlebarsHelper.new(handlebars, context)
          instance.register_string_helpers
    Severity: Minor
    Found in lib/hiptest-publisher/handlebars_helper.rb - About 2 hrs to fix

      Method as_hh_join has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def as_hh_join(context, items, joiner, name, block, else_block = nil)
      Severity: Minor
      Found in lib/hiptest-publisher/handlebars_helper.rb - About 45 mins to fix

        Method hh_join has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def hh_join(context, items, joiner, block, else_block = nil)
        Severity: Minor
        Found in lib/hiptest-publisher/handlebars_helper.rb - About 35 mins to fix

          Method hh_if_includes has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def hh_if_includes(context, expression, element, block_true, block_false = nil)
          Severity: Minor
          Found in lib/hiptest-publisher/handlebars_helper.rb - About 35 mins to fix

            Method as_hh_join has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def as_hh_join(context, items, joiner, name, block, else_block = nil)
                  joiner = joiner.to_s
                  joiner.gsub!(/\\t/, "\t")
                  joiner.gsub!(/\\n/, "\n")
            
            
            Severity: Minor
            Found in lib/hiptest-publisher/handlebars_helper.rb - About 25 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

            There are no issues that match your filters.

            Category
            Status