Showing 4 of 8 total issues
Class API
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class API
QUEUE_ENDPOINT_URL = 'https://syrup.keboola.com/queue/'
WRITER_ENDPOINT_URL = 'https://syrup.keboola.com/gooddata-writer/'
QUEUE_MOCK_ENDPOINT_URL = 'https://private-anon-c1bf53b9c-syrupqueue.apiary-mock.com/queue/'
WRITER_MOCK_ENDPOINT_URL = 'https://private-anon-df256c5fb-keboolagooddatawriter.apiary-mock.com/gooddata-writer/'
Method create_filter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_filter(writer_id, project_id, name, attribute, value, operator = '=', optionals: {}, async: true)
Method create_user
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def create_user(writer_id, email, password, first_name, last_name, optionals: {}, async: true)
Method handle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def handle(response, &handler)
result = case response.status_type
when :success # Is this a 2xx response?
@parser.parse(response.body)
- Read upRead up
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"