NeverBounce/NeverBounceApi-Ruby

View on GitHub
lib/never_bounce/api/client.rb

Summary

Maintainability
A
25 mins
Test Coverage

Avoid parameter lists longer than 5 parameters. [7/5]
Open

    def jobs_create(auto_parse: false, auto_start: false, filename: nil, remote_input: nil, run_sample: false, supplied_input: nil, historical: nil)
Severity: Minor
Found in lib/never_bounce/api/client.rb by rubocop

This cop checks for methods with too many parameters. The maximum number of parameters is configurable. Keyword arguments can optionally be excluded from the total count.

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

    def jobs_create(auto_parse: false, auto_start: false, filename: nil, remote_input: nil, run_sample: false, supplied_input: nil, historical: nil)
      raise ArgumentError, "`remote_input` and `supplied_input` can't both be given" if remote_input && supplied_input

      input_location = if (v = remote_input)
        # NOTE: Logical order: type, then value.
Severity: Minor
Found in lib/never_bounce/api/client.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