woese/guara-crm

View on GitHub

Showing 48 of 101 total issues

Avoid too many return statements within this method.
Open

          return
Severity: Major
Found in lib/active_migration/converters/rtf_to_html.rb - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return if section[:text].empty?
    Severity: Major
    Found in lib/active_migration/converters/rtf_to_html.rb - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                return
      Severity: Major
      Found in lib/active_migration/converters/rtf_to_html.rb - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                  return
        Severity: Major
        Found in lib/active_migration/converters/rtf_to_html.rb - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                    return
          Severity: Major
          Found in lib/active_migration/converters/rtf_to_html.rb - About 30 mins to fix

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

                  def save_on_cache
                
                    #cached path
                    @cache_path = "db/external_migrate/cache/" 
                    Dir.mkdir path if not Dir.exists? @cache_path
            Severity: Minor
            Found in lib/active_migration/transformer/grouped_field_fixed_spelling.rb - About 25 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

              def update_advanced_fields    
                @person.segments = params[:segments_select] ? params[:segments_select].collect { |bsid| BusinessSegment.find bsid }.uniq : []
                @person.activities = params[:activities_select] ? params[:activities_select].collect { |baid| BusinessActivity.find baid }.uniq : []
                
                @person.associateds = params[:associateds_select] ? params[:associateds_select].collect { |assoc| CustomerPj.find assoc }.uniq : []    
            Severity: Minor
            Found in app/controllers/customers_controller.rb - About 25 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

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

              def validate_each(record,attribute,value)
                begin
                  m = Mail::Address.new(value)
                  # We must check that value contains a domain and that value is an email address
                  r = m.domain && m.address == value
            Severity: Minor
            Found in app/validators/email_validator.rb - About 25 mins to fix

            Cognitive Complexity

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

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

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

            Further reading

            Severity
            Category
            Status
            Source
            Language