aitherios/rnfse

View on GitHub

Showing 25 of 25 total issues

Method replace_key_values has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def self.replace_key_values(obj, key, &block)
      parent, children = case
                         when key.kind_of?(::Regexp)
                           [ key, [] ]
                         when key.kind_of?(::Array)
Severity: Minor
Found in lib/rnfse/hash.rb - About 1 hr to fix

    Method replace_key_values has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.replace_key_values(obj, key, &block)
          parent, children = case
                             when key.kind_of?(::Regexp)
                               [ key, [] ]
                             when key.kind_of?(::Array)
    Severity: Minor
    Found in lib/rnfse/hash.rb - About 55 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

    Method parse_response has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def parse_response(response)
          hash = Rnfse::Hash.new(response.body)
    
          response_key = hash.keys.select { |k| k =~ /response$/ }
          response_key = response_key.first unless response_key.nil?
    Severity: Minor
    Found in lib/rnfse/api/abrasf_1_0.rb - About 55 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 consultar_lote_rps(hash = {})
        validate_options(hash)
        validate_ascii(hash)
        header = xml_builder.build_header_xml()
        parameters = xml_builder.build_consultar_lote_rps_envio_xml(hash)
    Severity: Major
    Found in lib/rnfse/api/speed_gov_1_0.rb and 3 other locations - About 45 mins to fix
    lib/rnfse/api/speed_gov_1_0.rb on lines 22..33
    lib/rnfse/api/speed_gov_1_0.rb on lines 50..61
    lib/rnfse/api/speed_gov_1_0.rb on lines 64..75

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

    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 consultar_situacao_lote_rps(hash = {})
        validate_options(hash)
        validate_ascii(hash)
        header = xml_builder.build_header_xml()
        parameters = xml_builder.build_consultar_situacao_lote_rps_envio_xml(hash)
    Severity: Major
    Found in lib/rnfse/api/speed_gov_1_0.rb and 3 other locations - About 45 mins to fix
    lib/rnfse/api/speed_gov_1_0.rb on lines 36..47
    lib/rnfse/api/speed_gov_1_0.rb on lines 50..61
    lib/rnfse/api/speed_gov_1_0.rb on lines 64..75

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

    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 consultar_nfse_por_rps(hash = {})
        validate_options(hash)
        validate_ascii(hash)
        header = xml_builder.build_header_xml()
        parameters = xml_builder.build_consultar_nfse_rps_envio_xml(hash)
    Severity: Major
    Found in lib/rnfse/api/speed_gov_1_0.rb and 3 other locations - About 45 mins to fix
    lib/rnfse/api/speed_gov_1_0.rb on lines 22..33
    lib/rnfse/api/speed_gov_1_0.rb on lines 36..47
    lib/rnfse/api/speed_gov_1_0.rb on lines 64..75

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

    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 consultar_nfse(hash = {})
        validate_options(hash)
        validate_ascii(hash)
        header = xml_builder.build_header_xml()
        parameters = xml_builder.build_consultar_nfse_envio_xml(hash)
    Severity: Major
    Found in lib/rnfse/api/speed_gov_1_0.rb and 3 other locations - About 45 mins to fix
    lib/rnfse/api/speed_gov_1_0.rb on lines 22..33
    lib/rnfse/api/speed_gov_1_0.rb on lines 36..47
    lib/rnfse/api/speed_gov_1_0.rb on lines 50..61

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

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

      def build_consultar_lote_rps_envio_xml(hash = {})
        hash = prepare_hash(hash)
        hash = add_p_namespace(hash, /(Prestador|Protocolo)/)
        inner_xml = ::Gyoku.xml(hash, key_converter: :none)
        Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    Severity: Major
    Found in lib/rnfse/xml_builder/speed_gov_1_0.rb and 5 other locations - About 40 mins to fix
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 6..12
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 17..23
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 42..56
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 68..74
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 86..92

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

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

      def build_consultar_nfse_envio_xml(hash = {})
        hash = prepare_hash(hash)
        hash = add_p_namespace(hash, %r{
                                         (Prestador|
                                          NumeroNfse|
    Severity: Major
    Found in lib/rnfse/xml_builder/speed_gov_1_0.rb and 5 other locations - About 40 mins to fix
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 6..12
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 17..23
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 68..74
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 86..92
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 104..110

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

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

      def build_consultar_nfse_rps_envio_xml(hash = {})
        hash = prepare_hash(hash)
        hash = add_p_namespace(hash, /(Prestador|IdentificacaoRps)/)
        inner_xml = ::Gyoku.xml(hash, key_converter: :none)
        Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    Severity: Major
    Found in lib/rnfse/xml_builder/speed_gov_1_0.rb and 5 other locations - About 40 mins to fix
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 6..12
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 17..23
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 42..56
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 86..92
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 104..110

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

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

      def build_consultar_situacao_lote_rps_envio_xml(hash = {})
        hash = prepare_hash(hash)
        hash = add_p_namespace(hash, /(Prestador|Protocolo)/)
        inner_xml = ::Gyoku.xml(hash, key_converter: :none)
        Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    Severity: Major
    Found in lib/rnfse/xml_builder/speed_gov_1_0.rb and 5 other locations - About 40 mins to fix
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 6..12
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 17..23
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 42..56
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 68..74
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 104..110

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

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

      def build_recepcionar_lote_rps_xml(hash = {})
        hash = prepare_hash(hash)
        hash = add_p_namespace(hash, /LoteRps/)
        inner_xml = ::Gyoku.xml(hash, key_converter: :none)
        Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    Severity: Major
    Found in lib/rnfse/xml_builder/speed_gov_1_0.rb and 5 other locations - About 40 mins to fix
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 17..23
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 42..56
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 68..74
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 86..92
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 104..110

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

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

      def build_consultar_situacao_lote_rps_envio_xml(hash = {})
        hash = prepare_hash(hash)
        hash = add_p_namespace(hash, /(Prestador|Protocolo)/)
        inner_xml = ::Gyoku.xml(hash, key_converter: :none)
        Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
    Severity: Major
    Found in lib/rnfse/xml_builder/speed_gov_1_0.rb and 5 other locations - About 40 mins to fix
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 6..12
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 42..56
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 68..74
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 86..92
    lib/rnfse/xml_builder/speed_gov_1_0.rb on lines 104..110

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

    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 transform_values has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def self.transform_values(obj, key, &block)
          key = /\A#{key}\Z/ unless key.kind_of?(::Regexp)
    
          case
          when obj.kind_of?(::Hash)
    Severity: Minor
    Found in lib/rnfse/hash.rb - About 35 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

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

        def self.transform_keys(obj, regex = nil, &block)
          regex = /.*/ if regex.nil?
    
          case
          when obj.kind_of?(::Hash)
    Severity: Minor
    Found in lib/rnfse/hash.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 6 locations. Consider refactoring.
    Open

        def consultar_lote_rps(hash = {})
          validate_options(hash)
          xml = xml_builder.build_consultar_lote_rps_xml(hash)
          response = self.soap_client.call(
            :consultar_lote_rps,
    Severity: Major
    Found in lib/rnfse/api/abrasf_1_0.rb and 5 other locations - About 25 mins to fix
    lib/rnfse/api/abrasf_1_0.rb on lines 39..47
    lib/rnfse/api/abrasf_1_0.rb on lines 50..58
    lib/rnfse/api/abrasf_1_0.rb on lines 61..69
    lib/rnfse/api/iss_net_1_0.rb on lines 28..36
    lib/rnfse/api/iss_net_1_0.rb on lines 39..47

    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

          when has_options(options, 'provedor', 'homologacao')
            provedor = provedores['homologacao'][options['provedor'].to_s]
            raise ArgumentError, 'provedor de homologação inexistente', caller if provedor.nil?
            self.api = provedor['api']
            load_options_method = :load_options_for_staging
    Severity: Minor
    Found in lib/rnfse/api.rb and 1 other location - About 25 mins to fix
    lib/rnfse/api.rb on lines 25..29

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

      def consultar_situacao_lote_rps(hash = {})
        validate_options(hash)
        xml = xml_builder.build_consultar_situacao_lote_rps_xml(hash)
        response = self.soap_client.call(
          :consultar_situacao_lote_rps,
    Severity: Major
    Found in lib/rnfse/api/iss_net_1_0.rb and 5 other locations - About 25 mins to fix
    lib/rnfse/api/abrasf_1_0.rb on lines 39..47
    lib/rnfse/api/abrasf_1_0.rb on lines 50..58
    lib/rnfse/api/abrasf_1_0.rb on lines 61..69
    lib/rnfse/api/abrasf_1_0.rb on lines 72..80
    lib/rnfse/api/iss_net_1_0.rb on lines 39..47

    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

          when has_options(options, 'provedor', 'municipio')
            provedor = provedores['producao'][options['provedor'].to_s]
            raise ArgumentError, 'provedor inexistente', caller if provedor.nil?
            self.api = provedor['api']
            load_options_method = :load_options_for_production
    Severity: Minor
    Found in lib/rnfse/api.rb and 1 other location - About 25 mins to fix
    lib/rnfse/api.rb on lines 19..23

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

        def consultar_situacao_lote_rps(hash = {})
          validate_options(hash)
          xml = xml_builder.build_consultar_situacao_lote_rps_xml(hash)
          response = self.soap_client.call(
            :consultar_situacao_lote_rps,
    Severity: Major
    Found in lib/rnfse/api/abrasf_1_0.rb and 5 other locations - About 25 mins to fix
    lib/rnfse/api/abrasf_1_0.rb on lines 50..58
    lib/rnfse/api/abrasf_1_0.rb on lines 61..69
    lib/rnfse/api/abrasf_1_0.rb on lines 72..80
    lib/rnfse/api/iss_net_1_0.rb on lines 28..36
    lib/rnfse/api/iss_net_1_0.rb on lines 39..47

    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

    Severity
    Category
    Status
    Source
    Language