romansklenar/gooddata-writer-ruby-client

View on GitHub

Showing 4 of 8 total issues

Class API has 43 methods (exceeds 20 allowed). Consider refactoring.
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/'
Severity: Minor
Found in lib/keboola/gooddata_writer/api.rb - About 5 hrs to fix

    Method create_filter has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def create_filter(writer_id, project_id, name, attribute, value, operator = '=', optionals: {}, async: true)
    Severity: Minor
    Found in lib/keboola/gooddata_writer/api.rb - About 45 mins to fix

      Method create_user has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def create_user(writer_id, email, password, first_name, last_name, optionals: {}, async: true)
      Severity: Minor
      Found in lib/keboola/gooddata_writer/api.rb - About 35 mins to fix

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

              def handle(response, &handler)
                result = case response.status_type
                  when :success # Is this a 2xx response?
                    @parser.parse(response.body)
        
        
        Severity: Minor
        Found in lib/keboola/gooddata_writer/api.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