dmichael/amazon-mws

View on GitHub

Showing 16 of 16 total issues

Method request has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

      def request(verb, path, query_params, body = nil, attempts = 0, &block)
        # presumably this is for files
        body.rewind if body.respond_to?(:rewind) unless attempts.zero?
        # Prepare the Proc to be called by Net::HTTP
        proc = requester(verb, path, query_params, body)
Severity: Minor
Found in lib/amazon/mws/connection.rb - About 1 hr 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

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

      def request(verb, path, query_params = {}, body = nil, attempts = 0, &block)
Severity: Minor
Found in lib/amazon/mws/base.rb - About 45 mins to fix

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

          def request(verb, path, query_params, body = nil, attempts = 0, &block)
    Severity: Minor
    Found in lib/amazon/mws/connection.rb - About 45 mins to fix

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

        module MWS
      
          class GetFeedSubmissionListByNextTokenResponse < Response
            xml_name "GetFeedSubmissionListByNextTokenResponse"
            result = "GetFeedSubmissionListByNextTokenResult"
      lib/amazon/mws/response/get_feed_submission_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_response.rb on lines 2..12

      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 30.

      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

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

          def process_body(body)
            @request.content_length = 0 and return self if body.nil?
      
            if body.respond_to?(:read)                                                                
              @request.body_stream = body                                                           
      Severity: Minor
      Found in lib/amazon/mws/connection/request_builder.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 7 locations. Consider refactoring.
      Open

        module MWS
      
          class GetReportScheduleListResponse < Response
            xml_name "GetReportScheduleListResponse"
            result = "GetReportScheduleListResult"
      Severity: Major
      Found in lib/amazon/mws/response/get_report_schedule_list_response.rb and 6 other locations - About 25 mins to fix
      lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_feed_submission_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb on lines 2..12

      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 30.

      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 7 locations. Consider refactoring.
      Open

        module MWS
      
          class GetReportListResponse < Response
            xml_name "GetReportListResponse"
            result = "GetReportListResult"
      Severity: Major
      Found in lib/amazon/mws/response/get_report_list_response.rb and 6 other locations - About 25 mins to fix
      lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_feed_submission_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_response.rb on lines 2..12

      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 30.

      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

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

        def require_library_or_gem(library, gem_name = nil)
          if RUBY_VERSION >= '1.9'
            gem(gem_name || library, '>=0') 
          end
          require library
      Severity: Minor
      Found in lib/amazon/mws/lib/extensions.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 7 locations. Consider refactoring.
      Open

        module MWS
      
          class GetReportScheduleListByNextTokenResponse < Response
            xml_name "GetReportScheduleListByNextTokenResponse"
            result = "GetReportScheduleListByNextTokenResult"
      lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_feed_submission_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_response.rb on lines 2..12

      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 30.

      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 7 locations. Consider refactoring.
      Open

        module MWS
      
          class GetReportRequestListByNextTokenResponse < Response
            xml_name "GetReportRequestListByNextTokenResponse"
            result = "GetReportRequestListByNextTokenResult"
      lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_feed_submission_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_response.rb on lines 2..12

      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 30.

      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 7 locations. Consider refactoring.
      Open

        module MWS
      
          class GetFeedSubmissionListResponse < Response
            xml_name "GetFeedSubmissionListResponse"
            result = "GetFeedSubmissionListResult"
      Severity: Major
      Found in lib/amazon/mws/response/get_feed_submission_list_response.rb and 6 other locations - About 25 mins to fix
      lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_response.rb on lines 2..12

      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 30.

      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 7 locations. Consider refactoring.
      Open

        module MWS
      
          class GetReportRequestListResponse < Response
            xml_name "GetReportRequestListResponse"
            result = "GetReportRequestListResult"
      Severity: Major
      Found in lib/amazon/mws/response/get_report_request_list_response.rb and 6 other locations - About 25 mins to fix
      lib/amazon/mws/response/get_feed_submission_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_feed_submission_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_list_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_request_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_by_next_token_response.rb on lines 2..12
      lib/amazon/mws/response/get_report_schedule_list_response.rb on lines 2..12

      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 30.

      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 2 locations. Consider refactoring.
      Open

        def cattr_writer(*syms)
          syms.flatten.each do |sym|
            class_eval(<<-EOS, __FILE__, __LINE__)
              unless defined? @@#{sym}
                @@#{sym} = nil
      Severity: Minor
      Found in lib/amazon/mws/lib/extensions.rb and 1 other location - About 25 mins to fix
      lib/amazon/mws/lib/extensions.rb on lines 122..136

      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 29.

      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 2 locations. Consider refactoring.
      Open

        def cattr_reader(*syms)
          syms.flatten.each do |sym|
            class_eval(<<-EOS, __FILE__, __LINE__)
              unless defined? @@#{sym}
                @@#{sym} = nil
      Severity: Minor
      Found in lib/amazon/mws/lib/extensions.rb and 1 other location - About 25 mins to fix
      lib/amazon/mws/lib/extensions.rb on lines 140..154

      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 29.

      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 2 locations. Consider refactoring.
      Open

        module MWS
      
          class CancelReportRequestsResponse < Response
            xml_name "CancelReportRequestsResponse"
            result = "CancelReportRequestsResult"
      Severity: Minor
      Found in lib/amazon/mws/response/cancel_report_requests_response.rb and 1 other location - About 20 mins to fix
      lib/amazon/mws/response/cancel_feed_submissions_response.rb on lines 2..11

      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 27.

      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 2 locations. Consider refactoring.
      Open

        module MWS
      
          class CancelFeedSubmissionsResponse < Response
            xml_name "CancelFeedSubmissionsResponse"
            result = "CancelFeedSubmissionsResult"
      Severity: Minor
      Found in lib/amazon/mws/response/cancel_feed_submissions_response.rb and 1 other location - About 20 mins to fix
      lib/amazon/mws/response/cancel_report_requests_response.rb on lines 2..11

      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 27.

      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