romansklenar/gooddata-writer-ruby-client

View on GitHub

Showing 8 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

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

              def execute_reports(writer_id, project_id, optionals: {}, async: true)
                params = { writerId: writer_id, pid: project_id }.reverse_merge(optionals)
                handle(@client.post("execute-reports", params.to_json)) { |result| job_handler(result, async) }
        Severity: Minor
        Found in lib/keboola/gooddata_writer/api.rb and 3 other locations - About 15 mins to fix
        lib/keboola/gooddata_writer/api.rb on lines 151..153
        lib/keboola/gooddata_writer/api.rb on lines 164..166
        lib/keboola/gooddata_writer/api.rb on lines 170..172

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 25.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

              def upload_table(writer_id, table_id, optionals: {}, async: true)
                params = { writerId: writer_id, tableId: table_id }.reverse_merge(optionals)
                handle(@client.post("upload-table", params.to_json)) { |result| job_handler(result, async) }
        Severity: Minor
        Found in lib/keboola/gooddata_writer/api.rb and 3 other locations - About 15 mins to fix
        lib/keboola/gooddata_writer/api.rb on lines 164..166
        lib/keboola/gooddata_writer/api.rb on lines 170..172
        lib/keboola/gooddata_writer/api.rb on lines 237..239

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 25.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

              def upload_date_dimension(writer_id, name, optionals: {}, async: true)
                params = { writerId: writer_id, name: name }.reverse_merge(optionals)
                handle(@client.post("reset-table", params.to_json)) { |result| job_handler(result, async) }
        Severity: Minor
        Found in lib/keboola/gooddata_writer/api.rb and 3 other locations - About 15 mins to fix
        lib/keboola/gooddata_writer/api.rb on lines 151..153
        lib/keboola/gooddata_writer/api.rb on lines 164..166
        lib/keboola/gooddata_writer/api.rb on lines 237..239

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 25.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

              def reset_table(writer_id, table_id, optionals: {}, async: true)
                params = { writerId: writer_id, tableId: table_id }.reverse_merge(optionals)
                handle(@client.post("reset-table", params.to_json)) { |result| job_handler(result, async) }
        Severity: Minor
        Found in lib/keboola/gooddata_writer/api.rb and 3 other locations - About 15 mins to fix
        lib/keboola/gooddata_writer/api.rb on lines 151..153
        lib/keboola/gooddata_writer/api.rb on lines 170..172
        lib/keboola/gooddata_writer/api.rb on lines 237..239

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 25.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language