travis-ci/job-board

View on GitHub
lib/job_board/job_queries_transformer.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method build_candidate_tags has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private def build_candidate_tags
      full_tag_set = {}
      candidate_tags = []

      add_default_tag = proc do |tag|
Severity: Minor
Found in lib/job_board/job_queries_transformer.rb - About 2 hrs to fix

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

        private def build_candidate_tags
          full_tag_set = {}
          candidate_tags = []
    
          add_default_tag = proc do |tag|
    Severity: Minor
    Found in lib/job_board/job_queries_transformer.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

    Empty line detected around arguments.
    Open

    
          if osx? && has?('osx_image')

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          if has?('dist', 'language') && !osx?

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          [full_tag_set] + candidate_tags

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          add_tags = proc do |tags|

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          add_default_tag.call(language_key => 'true') if has?('language')

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          if has?('os', 'language')

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          if has?('group', 'language')

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          add_default_tag = proc do |tag|

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    Empty line detected around arguments.
    Open

    
          if has?('dist', 'group', 'language')

    This cops checks if empty lines exist around the arguments of a method invocation.

    Example:

    # bad
    do_something(
      foo
    
    )
    
    process(bar,
    
            baz: qux,
            thud: fred)
    
    some_method(
    
      [1,2,3],
      x: y
    )
    
    # good
    do_something(
      foo
    )
    
    process(bar,
            baz: qux,
            thud: fred)
    
    some_method(
      [1,2,3],
      x: y
    )

    There are no issues that match your filters.

    Category
    Status