travis-ci/job-board

View on GitHub
lib/job_board/services/fetch_job.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method run has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def run
        return nil if job_id.empty? || site.empty?

        job = {}
        db_job = fetch_db_job
Severity: Minor
Found in lib/job_board/services/fetch_job.rb - About 1 hr to fix

    Prefer annotated tokens (like %<foo>s</foo>) over template tokens (like %{foo}).
    Open

              job_state_url: job_id_url('job_state_%{site}_url'),
    Severity: Minor
    Found in lib/job_board/services/fetch_job.rb by rubocop

    Use a consistent style for named format string tokens.

    Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

    Example: EnforcedStyle: annotated (default)

    # bad
    format('%{greeting}', greeting: 'Hello')
    format('%s', 'Hello')
    
    # good
    format('%<greeting>s', greeting: 'Hello')</greeting>

    Example: EnforcedStyle: template

    # bad
    format('%<greeting>s', greeting: 'Hello')
    format('%s', 'Hello')
    
    # good
    format('%{greeting}', greeting: 'Hello')</greeting>

    Example: EnforcedStyle: unannotated

    # bad
    format('%<greeting>s', greeting: 'Hello')
    format('%{greeting}', 'Hello')
    
    # good
    format('%s', 'Hello')</greeting>

    Empty line detected around arguments.
    Open

    
            job_copy
    Severity: Minor
    Found in lib/job_board/services/fetch_job.rb by rubocop

    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

    
            SELECT_KEYS.each do |data_key, select_keys|
    Severity: Minor
    Found in lib/job_board/services/fetch_job.rb by rubocop

    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
    )

    Prefer annotated tokens (like %<foo>s</foo>) over template tokens (like %{foo}).
    Open

              log_parts_url: job_id_url('log_parts_%{site}_url'),
    Severity: Minor
    Found in lib/job_board/services/fetch_job.rb by rubocop

    Use a consistent style for named format string tokens.

    Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

    Example: EnforcedStyle: annotated (default)

    # bad
    format('%{greeting}', greeting: 'Hello')
    format('%s', 'Hello')
    
    # good
    format('%<greeting>s', greeting: 'Hello')</greeting>

    Example: EnforcedStyle: template

    # bad
    format('%<greeting>s', greeting: 'Hello')
    format('%s', 'Hello')
    
    # good
    format('%{greeting}', greeting: 'Hello')</greeting>

    Example: EnforcedStyle: unannotated

    # bad
    format('%<greeting>s', greeting: 'Hello')
    format('%{greeting}', 'Hello')
    
    # good
    format('%s', 'Hello')</greeting>

    There are no issues that match your filters.

    Category
    Status