projectcypress/health-data-standards

View on GitHub
test/unit/hqmf/model/nqf_0002_test.rb

Summary

Maintainability
F
3 days
Test Coverage

Method test_to_json_0002 has 234 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def test_to_json_0002

      codes = {
        "2.16.840.1.113883.3.560.100.2" => {"HL7"=>["F"]},
        "2.16.840.1.113883.1.11.1" => {"HL7" => ["M","F","UN"]},
Severity: Major
Found in test/unit/hqmf/model/nqf_0002_test.rb - About 1 day to fix

    File nqf_0002_test.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require_relative '../../../test_helper'
    module HQMFModel
    
      class NQF0002Test  < Minitest::Test    
        def setup
    Severity: Minor
    Found in test/unit/hqmf/model/nqf_0002_test.rb - About 4 hrs to fix

      Method data_criteria_matches has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
      Open

          def data_criteria_matches(expected, actual)
            matches = true
      
            matches &&= actual[:description] == expected[:description]
            matches &&= expected[:code_list_id] == actual[:code_list_id]
      Severity: Minor
      Found in test/unit/hqmf/model/nqf_0002_test.rb - About 4 hrs 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 data_criteria_matches has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def data_criteria_matches(expected, actual)
            matches = true
      
            matches &&= actual[:description] == expected[:description]
            matches &&= expected[:code_list_id] == actual[:code_list_id]
      Severity: Minor
      Found in test/unit/hqmf/model/nqf_0002_test.rb - About 1 hr to fix

        Method test_to_json_0002 has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

            def test_to_json_0002
        
              codes = {
                "2.16.840.1.113883.3.560.100.2" => {"HL7"=>["F"]},
                "2.16.840.1.113883.1.11.1" => {"HL7" => ["M","F","UN"]},
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb - About 45 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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

              expected_dc[:EncounterEncounterAmbulatoryIncludingPediatrics] << {:title=>"Encounter ambulatory including pediatrics",:description=>"Encounter: Encounter ambulatory including pediatrics", :negation=>false,
                 :code_list_id=>"2.16.840.1.113883.3.464.10001.231",:type=>:encounters,:patient_api_function=>:encounters,
                 :temporal_references=>
                   [{:type=>"DURING", :reference=>"MeasurePeriod"},
                    {:type=>"SBS",:reference=>"GROUP_SBS",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"3", inclusive?:true, derived?:false}}}]}
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 1 other location - About 55 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 65..69

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

        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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

              expected_dc[:EncounterEncounterAmbulatoryIncludingPediatrics] << {:title=>"Encounter ambulatory including pediatrics",:description=>"Encounter: Encounter ambulatory including pediatrics", :negation=>false,
                 :code_list_id=>"2.16.840.1.113883.3.464.10001.231",:type=>:encounters,:patient_api_function=>:encounters,
                 :temporal_references=>
                  [{:type=>"DURING", :reference=>"MeasurePeriod"},
                   {:type=>"SBS",:reference=>"GROUP_SBS",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"3", inclusive?:true, derived?:false}}}]}
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 1 other location - About 55 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 89..93

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

        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

              expected_dc[:PatientCharacteristicBirthDate] << {:title=>"birth date",:description=>"Patient Characteristic: birth date", :negation=>false,
                    :code_list_id=>"2.16.840.1.113883.3.560.100.4",:property=>:birthtime,:inline_code_list=>age_codes,:type=>:characteristic, :patient_api_function=>nil,
                    :temporal_references=>[{:type=>"SBS",:reference=>"MeasurePeriod",:range=>{:type=>'IVL_PQ', :low=>{:type=>'PQ', :unit=>"a", :value=>"2", inclusive?:true, derived?:false}}}]}
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 1 other location - About 55 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 159..161

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

        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

              expected_dc[:PatientCharacteristicBirthDate] << {:title=>"birth date",:description=>"Patient Characteristic: birth date", :negation=>false,
                    :code_list_id=>"2.16.840.1.113883.3.560.100.4",:property=>:birthtime,:inline_code_list=>age_codes,:type=>:characteristic, :patient_api_function=>nil,
                    :temporal_references=>[{:type=>"SBS",:reference=>"MeasurePeriod",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"a", :value=>"17", inclusive?:true, derived?:false}}}]}
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 1 other location - About 55 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 155..157

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

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

              expected_dc[:LaboratoryTestPerformedGroupAStreptococcusTest] << {:title=>"Group A Streptococcus Test",:description=>"Laboratory Test, Performed: Group A Streptococcus Test", :negation=>false,
                 :code_list_id=>"2.16.840.1.113883.3.464.10001.250",:type=>:laboratory_tests, :patient_api_function=>:laboratoryTests,:status=>"performed",
                 :temporal_references=>[{:type=>"SBE",:reference=>"EncounterEncounterAmbulatoryIncludingPediatrics",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"3", inclusive?:true, derived?:false}}}]}
        Severity: Major
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 4 other locations - About 50 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 100..103
        test/unit/hqmf/model/nqf_0002_test.rb on lines 142..144
        test/unit/hqmf/model/nqf_0002_test.rb on lines 146..148
        test/unit/hqmf/model/nqf_0002_test.rb on lines 150..152

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

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

              expected_dc[:MedicationDispensedPharyngitisAntibiotics] << {:title=>"pharyngitis antibiotics",:description=>"Medication, Dispensed: pharyngitis antibiotics", :negation=>false,
                    :code_list_id=>"2.16.840.1.113883.3.464.10001.373",:type=>:medications,:patient_api_function=>:allMedications,:status=>"dispensed",
                    :temporal_references=>[{:type=>"SBS",:reference=>"EncounterEncounterAmbulatoryIncludingPediatrics",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"30", inclusive?:true, derived?:false}}}]}
        Severity: Major
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 4 other locations - About 50 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 76..78
        test/unit/hqmf/model/nqf_0002_test.rb on lines 100..103
        test/unit/hqmf/model/nqf_0002_test.rb on lines 146..148
        test/unit/hqmf/model/nqf_0002_test.rb on lines 150..152

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

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

              expected_dc[:MedicationActivePharyngitisAntibiotics] << {:title=>"pharyngitis antibiotics",:description=>"Medication, Active: pharyngitis antibiotics", :negation=>false,
                    :code_list_id=>"2.16.840.1.113883.3.464.10001.373",:type=>:medications,:patient_api_function=>:allMedications,:status=>"active",
                    :temporal_references=>[{:type=>"SBS",:reference=>"EncounterEncounterAmbulatoryIncludingPediatrics",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"30", inclusive?:true, derived?:false}}}]}
        Severity: Major
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 4 other locations - About 50 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 76..78
        test/unit/hqmf/model/nqf_0002_test.rb on lines 100..103
        test/unit/hqmf/model/nqf_0002_test.rb on lines 142..144
        test/unit/hqmf/model/nqf_0002_test.rb on lines 146..148

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

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

              expected_dc[:MedicationOrderPharyngitisAntibiotics] << {:title=>"pharyngitis antibiotics",:description=>"Medication, Order: pharyngitis antibiotics", :negation=>false,
                    :code_list_id=>"2.16.840.1.113883.3.464.10001.373",:type=>:medications,:patient_api_function=>:allMedications,:status=>"ordered",
                    :temporal_references=>[{:type=>"SBS",:reference=>"EncounterEncounterAmbulatoryIncludingPediatrics",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"30", inclusive?:true, derived?:false}}}]}
        Severity: Major
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 4 other locations - About 50 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 76..78
        test/unit/hqmf/model/nqf_0002_test.rb on lines 100..103
        test/unit/hqmf/model/nqf_0002_test.rb on lines 142..144
        test/unit/hqmf/model/nqf_0002_test.rb on lines 150..152

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

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

              expected_dc[:LaboratoryTestPerformedGroupAStreptococcusTest] << {:title=>"Group A Streptococcus Test",:description=>"Laboratory Test, Performed: Group A Streptococcus Test", :negation=>false,
                 :code_list_id=>"2.16.840.1.113883.3.464.10001.250",:type=>:laboratory_tests, :patient_api_function=>:laboratoryTests,:status=>"performed",
                 :temporal_references=>
                   [{:type=>"SAE",:reference=>"EncounterEncounterAmbulatoryIncludingPediatrics",:range=>{:type=>'IVL_PQ', :high=>{:type=>'PQ', :unit=>"d", :value=>"3", inclusive?:true, derived?:false}}}]}
        Severity: Major
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 4 other locations - About 50 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 76..78
        test/unit/hqmf/model/nqf_0002_test.rb on lines 142..144
        test/unit/hqmf/model/nqf_0002_test.rb on lines 146..148
        test/unit/hqmf/model/nqf_0002_test.rb on lines 150..152

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

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

              codes = {
                "2.16.840.1.113883.3.560.100.2" => {"HL7"=>["F"]},
                "2.16.840.1.113883.1.11.1" => {"HL7" => ["M","F","UN"]},
                "2.16.840.1.113883.3.560.100.4" => {'LOINC'=>['21112-8']},
                '2.16.840.1.113883.3.464.10001.373' => {},
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 2 other locations - About 30 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 12..22
        test/unit/hqmf/model/nqf_0002_test.rb on lines 333..343

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

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

              codes = {
                "2.16.840.1.113883.3.560.100.2" => {"HL7"=>["F"]},
                "2.16.840.1.113883.1.11.1" => {"HL7" => ["M","F","UN"]},
                "2.16.840.1.113883.3.560.100.4" => {'LOINC'=>['21112-8']},
                '2.16.840.1.113883.3.464.10001.373' => {},
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 2 other locations - About 30 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 303..313
        test/unit/hqmf/model/nqf_0002_test.rb on lines 333..343

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

        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

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

              codes = {
                "2.16.840.1.113883.3.560.100.2" => {"HL7"=>["F"]},
                "2.16.840.1.113883.1.11.1" => {"HL7" => ["M","F","UN"]},
                "2.16.840.1.113883.3.560.100.4" => {'LOINC'=>['21112-8']},
                '2.16.840.1.113883.3.464.10001.373' => {},
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 2 other locations - About 30 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 12..22
        test/unit/hqmf/model/nqf_0002_test.rb on lines 303..313

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

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

        expected_dc[:PatientCharacteristicRaceRace] = [
          {:title=>"Race",
           :description=>"Patient Characteristic Race: Race",
           :code_list_id=>"2.16.840.1.114222.4.11.836",
           :property=>:race,
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 2 other locations - About 15 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 188..198
        test/unit/hqmf/model/nqf_0002_test.rb on lines 200..210

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

        expected_dc[:PatientCharacteristicEthnicityEthnicity] = [
          {:title=>"Ethnicity",
           :description=>"Patient Characteristic Ethnicity: Ethnicity",
           :code_list_id=>"2.16.840.1.114222.4.11.837",
           :property=>:ethnicity,
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 2 other locations - About 15 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 176..186
        test/unit/hqmf/model/nqf_0002_test.rb on lines 200..210

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

        expected_dc[:PatientCharacteristicPayerPayer] = [
          {:title=>"Payer",
           :description=>"Patient Characteristic Payer: Payer",
           :code_list_id=>"2.16.840.1.113883.221.5",
           :property=>:payer,
        Severity: Minor
        Found in test/unit/hqmf/model/nqf_0002_test.rb and 2 other locations - About 15 mins to fix
        test/unit/hqmf/model/nqf_0002_test.rb on lines 176..186
        test/unit/hqmf/model/nqf_0002_test.rb on lines 188..198

        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

        There are no issues that match your filters.

        Category
        Status