Sage/validation_profiler

View on GitHub

Showing 26 of 30 total issues

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

  module Rules
    class MaxValidationRule < ValidationProfiler::Rules::ValidationRule

      def error_message(field, attributes, parent = nil)

Severity: Major
Found in lib/validation_profiler/rules/max_validation_rule.rb and 1 other location - About 2 hrs to fix
lib/validation_profiler/rules/min_validation_rule.rb on lines 2..46

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

  module Rules
    class MinValidationRule < ValidationProfiler::Rules::ValidationRule

      def error_message(field, attributes, parent = nil)

Severity: Major
Found in lib/validation_profiler/rules/min_validation_rule.rb and 1 other location - About 2 hrs to fix
lib/validation_profiler/rules/max_validation_rule.rb on lines 2..46

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

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

      def validate(obj, field, attributes = {}, parent = nil)

        #attempt to get the field value from the object
        field_value = get_field_value(obj, field)

Severity: Minor
Found in lib/validation_profiler/rules/guid_validation_rule.rb - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

      def validate(obj, field, attributes, _parent = nil)
        # attempt to get the field value from the object
        value = get_field_value(obj, field)

        condition_field = attributes[:condition_field]
Severity: Minor
Found in lib/validation_profiler/rules/condition_validation_rule.rb - About 1 hr to fix

    Method validate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def validate(obj, field, attributes, _parent = nil)
            # attempt to get the field value from the object
            value = get_field_value(obj, field)
    
            condition_field = attributes[:condition_field]
    Severity: Minor
    Found in lib/validation_profiler/rules/condition_validation_rule.rb - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

          def validate(obj, field, attributes = {}, parent = nil)
    
            #attempt to get the field value from the object
            field_value = get_field_value(obj, field)
    
    
    Severity: Minor
    Found in lib/validation_profiler/rules/guid_validation_rule.rb - About 1 hr to fix

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

            def validate(obj, field, attributes, parent = nil)
      
              min = attributes[:min]
              max = attributes[:max]
      
      
      Severity: Minor
      Found in lib/validation_profiler/rules/length_validation_rule.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

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

            def get_field_value(obj, field)
              # attempt to get the field value from the object
              field_value = nil
      
              # check if the object is a hash
      Severity: Minor
      Found in lib/validation_profiler/rules/validation_rule.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

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

            def error_message(field, attributes, parent = nil)
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
              end
      Severity: Minor
      Found in lib/validation_profiler/rules/length_validation_rule.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

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/integer_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/guid_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/decimal_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/date_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/required_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

      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

      Method validate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def validate(obj, profile, parent = nil)
            result = ValidationProfiler::ManagerResult.new
      
            validation_rules = profile.class_variable_get(:@@validation_rules)
      
      
      Severity: Minor
      Found in lib/validation_profiler/manager.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

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/time_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/email_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/regex_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/not_allowed_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

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

            def error_message(field, attributes = {}, parent = nil)
      
              field_name = field.to_s
              if parent != nil
                field_name = "#{parent.to_s}.#{field.to_s}"
      Severity: Major
      Found in lib/validation_profiler/rules/not_allowed_validation_rule.rb and 8 other locations - About 35 mins to fix
      lib/validation_profiler/rules/date_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/decimal_validation_rule.rb on lines 6..18
      lib/validation_profiler/rules/email_validation_rule.rb on lines 7..19
      lib/validation_profiler/rules/guid_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/integer_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/regex_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/required_validation_rule.rb on lines 5..17
      lib/validation_profiler/rules/time_validation_rule.rb on lines 5..17

      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

      Avoid too many return statements within this method.
      Open

                  return false
      Severity: Major
      Found in lib/validation_profiler/rules/guid_validation_rule.rb - About 30 mins to fix
        Severity
        Category
        Status
        Source
        Language