rossta/tacokit.rb

View on GitHub

Showing 2 of 2 total issues

Class Client has 44 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Client
    # Methods for the Cards API
    # @see https://developers.trello.com/advanced-reference/card
    module Cards
      # Retrieve a card by id or shortlink
Severity: Minor
Found in lib/tacokit/client/cards.rb - About 6 hrs to fix

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

        def method_missing(method, *args)
          attr_name, suffix = method.to_s.scan(/([a-z0-9\_]+)(\?|\=)?$/i).first
          if suffix == ATTR_SETTER
            setter_missing(attr_name, args.first)
          elsif attr_name && @_fields.include?(attr_name.to_sym)
    Severity: Minor
    Found in lib/tacokit/resource.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

    Severity
    Category
    Status
    Source
    Language