rSmart/rsmart_toolbox

View on GitHub

Showing 30 of 30 total issues

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

Avoid too many return statements within this method.
Open

      return opt[:default]
Severity: Major
Found in lib/kuali_toolbox/etl.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

          return nil
    Severity: Major
    Found in lib/kuali_toolbox/etl.rb - About 30 mins to fix

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

        def self.parse_string!(row, insert_str, values_str, opt={})
          raise ArgumentError, "opt[:name] is required!" unless opt[:name]
          str = parse_string( row[ to_symbol( opt[:name] ) ], opt )
          mutate_sql_stmt! insert_str, opt[:name], values_str, str
      Severity: Minor
      Found in lib/kuali_toolbox/etl.rb and 4 other locations - About 20 mins to fix
      lib/kuali_toolbox/etl.rb on lines 229..232
      lib/kuali_toolbox/etl.rb on lines 272..275
      lib/kuali_toolbox/etl.rb on lines 298..301
      lib/kuali_toolbox/etl.rb on lines 323..326

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

      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

        def self.parse_date!(row, insert_str, values_str, opt={})
          raise ArgumentError, "opt[:name] is required!" unless opt[:name]
          date = parse_date( row[ to_symbol( opt[:name] ) ], opt )
          mutate_sql_stmt! insert_str, opt[:name], values_str, date
      Severity: Minor
      Found in lib/kuali_toolbox/etl.rb and 4 other locations - About 20 mins to fix
      lib/kuali_toolbox/etl.rb on lines 196..199
      lib/kuali_toolbox/etl.rb on lines 229..232
      lib/kuali_toolbox/etl.rb on lines 298..301
      lib/kuali_toolbox/etl.rb on lines 323..326

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

      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

        def self.parse_integer!(row, insert_str, values_str, opt={})
          raise ArgumentError, "opt[:name] is required!" unless opt[:name]
          i = parse_integer( row[ to_symbol( opt[:name] ) ], opt )
          mutate_sql_stmt! insert_str, opt[:name], values_str, i
      Severity: Minor
      Found in lib/kuali_toolbox/etl.rb and 4 other locations - About 20 mins to fix
      lib/kuali_toolbox/etl.rb on lines 196..199
      lib/kuali_toolbox/etl.rb on lines 272..275
      lib/kuali_toolbox/etl.rb on lines 298..301
      lib/kuali_toolbox/etl.rb on lines 323..326

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

      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

        def self.parse_timestamp!(row, insert_str, values_str, opt={})
          raise ArgumentError, "opt[:name] is required!" unless opt[:name]
          timestamp = parse_datetime( row[ to_symbol( opt[:name] ) ], opt )
          mutate_sql_stmt! insert_str, opt[:name], values_str, timestamp
      Severity: Minor
      Found in lib/kuali_toolbox/etl.rb and 4 other locations - About 20 mins to fix
      lib/kuali_toolbox/etl.rb on lines 196..199
      lib/kuali_toolbox/etl.rb on lines 229..232
      lib/kuali_toolbox/etl.rb on lines 272..275
      lib/kuali_toolbox/etl.rb on lines 298..301

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

      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

        def self.parse_datetime!(row, insert_str, values_str, opt={})
          raise ArgumentError, "opt[:name] is required!" unless opt[:name]
          datetime = parse_datetime( row[ to_symbol( opt[:name] ) ], opt )
          mutate_sql_stmt! insert_str, opt[:name], values_str, datetime
      Severity: Minor
      Found in lib/kuali_toolbox/etl.rb and 4 other locations - About 20 mins to fix
      lib/kuali_toolbox/etl.rb on lines 196..199
      lib/kuali_toolbox/etl.rb on lines 229..232
      lib/kuali_toolbox/etl.rb on lines 272..275
      lib/kuali_toolbox/etl.rb on lines 323..326

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

      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