rSmart/rsmart_toolbox

View on GitHub
lib/kuali_toolbox/etl/grm.rb

Summary

Maintainability
C
1 day
Test Coverage

Method validate_hr_xml has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  def self.validate_hr_xml(xml_filename)
    ret_val = false
    # validate the resulting XML file against the official XSD schema
    uri = URI 'https://raw.githubusercontent.com/KualiCo/ce-tech-docs/master/v2_0/hrmanifest.xsd'
    Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
Severity: Minor
Found in lib/kuali_toolbox/etl/grm.rb - About 1 hr to fix

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

      def self.parse_suffix(str, opt={ name: 'SUFFIX_NM', length: 3, valid_values: /^(Jr|Sr|Mr|Md)?$/ })
        opt[:name]         = "SUFFIX_NM" if opt[:name].nil?
        opt[:length]       = 3 if opt[:length].nil?
        opt[:valid_values] = /^(Jr|Sr|Mr|Md)?$/ if opt[:valid_values].nil?
        opt[:upcase]       = false if opt[:upcase].nil?
    Severity: Major
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 1 hr to fix
    lib/kuali_toolbox/etl/grm.rb on lines 233..238

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

    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 self.parse_prefix(str, opt={ name: 'PREFIX_NM', length: 3, valid_values: /^(Ms|Mrs|Mr|Dr)?$/ })
        opt[:name]         = "PREFIX_NM" if opt[:name].nil?
        opt[:length]       = 3 if opt[:length].nil?
        opt[:valid_values] = /^(Ms|Mrs|Mr|Dr)?$/ if opt[:valid_values].nil?
        opt[:upcase]       = false if opt[:upcase].nil?
    Severity: Major
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 1 hr to fix
    lib/kuali_toolbox/etl/grm.rb on lines 247..252

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

    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 self.parse_owned_by_unit!(row, insert_str, values_str, opt={ name: 'OWNED_BY_UNIT', required: true, length: 8 })
        #   `OWNED_BY_UNIT` varchar(8) COLLATE utf8_bin NOT NULL,
        opt[:name]     = "OWNED_BY_UNIT" if opt[:name].nil?
        opt[:required] = true if opt[:required].nil?
        opt[:length]   = 8 if opt[:length].nil?
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 55 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 32..37

    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

      def self.parse_rolodex_id!(row, insert_str, values_str, opt={ name: 'ROLODEX_ID', required: true, length: 6 })
        #   `ROLODEX_ID` decimal(6,0) NOT NULL DEFAULT '0',
        opt[:name]     = "ROLODEX_ID" if opt[:name].nil?
        opt[:required] = true if opt[:required].nil?
        opt[:length]   = 6 if opt[:length].nil?
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 55 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 104..109

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

      def self.parse_phone_type(str, opt={ name: 'PHONE_TYP_CD', length: 3, valid_values: /^(FAX|HM|MBL|OTH|WRK)$/i })
        opt[:name]         = "PHONE_TYP_CD" if opt[:name].nil?
        opt[:length]       = 3 if opt[:length].nil?
        opt[:valid_values] = /^(FAX|HM|MBL|OTH|WRK)$/i if opt[:valid_values].nil?
        return KualiCo::ETL::parse_flag str, opt
    Severity: Major
    Found in lib/kuali_toolbox/etl/grm.rb and 3 other locations - About 55 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 206..210
    lib/kuali_toolbox/etl/grm.rb on lines 274..278
    lib/kuali_toolbox/etl/grm.rb on lines 287..291

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

      def self.parse_phone_number(str, opt={ name: 'PHONE_NBR', length: 12, valid_values: /^(\d{3}-\d{3}-\d{4})?$/ })
        opt[:name]         = "PHONE_NBR" if opt[:name].nil?
        opt[:length]       = 12 if opt[:length].nil?
        opt[:valid_values] = /^(\d{3}-\d{3}-\d{4})?$/ if opt[:valid_values].nil?
        return KualiCo::ETL::parse_string str, opt
    Severity: Major
    Found in lib/kuali_toolbox/etl/grm.rb and 3 other locations - About 55 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 206..210
    lib/kuali_toolbox/etl/grm.rb on lines 261..265
    lib/kuali_toolbox/etl/grm.rb on lines 287..291

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

      def self.parse_address_type_code(str, opt={ name: 'ADDR_TYP_CD', length: 3, valid_values: /^(HM|OTH|WRK)$/i })
        opt[:name]         = "ADDR_TYP_CD" if opt[:name].nil?
        opt[:length]       = 3 if opt[:length].nil?
        opt[:valid_values] = /^(HM|OTH|WRK)$/i if opt[:valid_values].nil?
        return KualiCo::ETL::parse_flag str, opt
    Severity: Major
    Found in lib/kuali_toolbox/etl/grm.rb and 3 other locations - About 55 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 261..265
    lib/kuali_toolbox/etl/grm.rb on lines 274..278
    lib/kuali_toolbox/etl/grm.rb on lines 287..291

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

      def self.parse_email_type(str, opt={ name: 'EMAIL_TYP_CD', length: 3, valid_values: /^(HM|OTH|WRK)$/i })
        opt[:name]         = "EMAIL_TYP_CD" if opt[:name].nil?
        opt[:length]       = 3 if opt[:length].nil?
        opt[:valid_values] = /^(HM|OTH|WRK)$/i if opt[:valid_values].nil?
        return KualiCo::ETL::parse_flag str, opt
    Severity: Major
    Found in lib/kuali_toolbox/etl/grm.rb and 3 other locations - About 55 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 206..210
    lib/kuali_toolbox/etl/grm.rb on lines 261..265
    lib/kuali_toolbox/etl/grm.rb on lines 274..278

    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

      def self.parse_emp_stat_cd(str, opt={ name: 'EMP_STAT_CD', valid_values: /^(A|D|L|N|P|R|S|T)$/i })
        #   `EMP_STAT_CD` varchar(40) COLLATE utf8_bin DEFAULT NULL,
        opt[:name]         = "EMP_STAT_CD" if opt[:name].nil?
        opt[:valid_values] = /^(A|D|L|N|P|R|S|T)$/i if opt[:valid_values].nil?
        opt[:required]     = true
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 40 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 192..197

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

      def self.parse_emp_typ_cd(str, opt={ name: 'EMP_TYP_CD', valid_values: /^(N|O|P)$/i })
        #   `EMP_TYP_CD` varchar(40) COLLATE utf8_bin DEFAULT NULL,
        opt[:name]         = "EMP_TYP_CD" if opt[:name].nil?
        opt[:valid_values] = /^(N|O|P)$/i if opt[:valid_values].nil?
        opt[:required]     = true
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 40 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 178..183

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

      def self.parse_actv_ind!(row, insert_str, values_str, opt={ name: 'ACTV_IND' })
        #   `ACTV_IND` varchar(1) COLLATE utf8_bin DEFAULT 'Y',
        opt[:name] = "ACTV_IND" if opt[:name].nil?
        actv_ind = parse_actv_ind row[ KualiCo::ETL::to_symbol( opt[:name] ) ]
        KualiCo::ETL::mutate_sql_stmt! insert_str, opt[:name], values_str, actv_ind
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 35 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 135..139

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

    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 self.parse_email_address!(row, insert_str, values_str, opt={ name: 'EMAIL_ADDRESS' })
        #   `EMAIL_ADDRESS` varchar(60) COLLATE utf8_bin DEFAULT NULL,
        opt[:name] = "EMAIL_ADDRESS" if opt[:name].nil?
        email_address = parse_email_address row[ KualiCo::ETL::to_symbol( opt[:name] ) ]
        KualiCo::ETL::mutate_sql_stmt! insert_str, opt[:name], values_str, email_address
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 1 other location - About 35 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 358..362

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

    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

      def self.parse_state!(row, insert_str, values_str, opt={ name: 'STATE', length: 30 })
        #   `STATE` varchar(30) COLLATE utf8_bin DEFAULT NULL,
        opt[:name]   = "STATE" if opt[:name].nil?
        opt[:length] = 30 if opt[:length].nil?
        KualiCo::ETL::parse_string! row, insert_str, values_str, opt
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 2 other locations - About 35 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 47..51
    lib/kuali_toolbox/etl/grm.rb on lines 90..94

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

    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

      def self.parse_postal_code!(row, insert_str, values_str, opt={ name: 'POSTAL_CODE', length: 15 })
        #   `POSTAL_CODE` varchar(15) COLLATE utf8_bin DEFAULT NULL,
        opt[:name]   = "POSTAL_CODE" if opt[:name].nil?
        opt[:length] = 15 if opt[:length].nil?
        KualiCo::ETL::parse_string! row, insert_str, values_str, opt
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 2 other locations - About 35 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 47..51
    lib/kuali_toolbox/etl/grm.rb on lines 61..65

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

    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

      def self.parse_country_code!(row, insert_str, values_str, opt={ name: 'COUNTRY_CODE', length: 3 })
        #   `COUNTRY_CODE` char(3) COLLATE utf8_bin DEFAULT NULL,
        opt[:name]   = "COUNTRY_CODE" if opt[:name].nil?
        opt[:length] = 3 if opt[:length].nil?
        KualiCo::ETL::parse_string! row, insert_str, values_str, opt
    Severity: Minor
    Found in lib/kuali_toolbox/etl/grm.rb and 2 other locations - About 35 mins to fix
    lib/kuali_toolbox/etl/grm.rb on lines 61..65
    lib/kuali_toolbox/etl/grm.rb on lines 90..94

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

    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