volontariat/voluntary

View on GitHub

Showing 146 of 242 total issues

Avoid too many return statements within this function.
Open

                    return this;
Severity: Major
Found in app/assets/javascripts/voluntary/optional_lib/jquery.location_picker.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return defaultMatcher(f);
    Severity: Major
    Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return -1;
      Severity: Major
      Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                                return {
                                    map: gmapContext.map,
                                    marker: gmapContext.marker,
                                    location: locationObj
                                }
        Severity: Major
        Found in app/assets/javascripts/voluntary/optional_lib/jquery.location_picker.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return null;
          Severity: Major
          Found in app/assets/javascripts/voluntary/optional_lib/jquery.location_picker.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return this.each(function() {
                        var $target = $(this);
                        // If plug-in hasn't been applied before - initialize, otherwise - skip
                        if (isPluginApplied(this)){
                          updateMap(getContextForElement(this), $(this), options);
            Severity: Major
            Found in app/assets/javascripts/voluntary/optional_lib/jquery.location_picker.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return 0;
              Severity: Major
              Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return null;
                Severity: Major
                Found in app/assets/javascripts/voluntary/optional_lib/jquery.location_picker.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return 0;
                  Severity: Major
                  Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return fuzzyMatcher(f, isObject);
                    Severity: Major
                    Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return el[map];
                      Severity: Major
                      Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return 1;
                        Severity: Major
                        Found in app/assets/javascripts/voluntary/lib/sugar.js - About 30 mins to fix

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

                              def show_association(association)
                                if association.to_s == association.to_s.pluralize
                                  return show_attribute(
                                    association,
                                    title: t("#{association}.index.title"), 
                          Severity: Minor
                          Found in app/helpers/voluntary/show_helper.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 set_i18n_locale_from_params has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                    def set_i18n_locale_from_params
                                      if params[:locale]
                                        if I18n.available_locales.include?(params[:locale].to_sym)
                                          I18n.locale = params[:locale]
                                        else
                          Severity: Minor
                          Found in lib/applicat/mvc/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 breadcrumbs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def breadcrumbs
                                result = render_navigation context: application_navigation, renderer: :breadcrumbs_without_method_links, join_with: ' > '
                                result = result && result.scan('<a').length > 1 ? result : ''
                                
                                if respond_to?(:resource) && resource.respond_to?(:ancestors)
                          Severity: Minor
                          Found in app/helpers/voluntary/layout_helper.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 keyword_settings_present has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                    def keyword_settings_present
                                      return unless self.with_keywords.present?
                                      
                                      [:min_number_of_keywords, :max_number_of_keywords].each do |attribute|
                                        if self.send(attribute).blank?
                          Severity: Minor
                          Found in lib/model/mongo_db/product/keywords.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 resource_exists? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                    def resource_exists?(name)
                                      if eval("@#{name}.nil?") || (eval("@#{name}.class.name") != name.classify && eval("@#{name}.class.superclass.name") != name.classify) || eval("@#{name}.id.nil?")
                                        return false
                                      else
                                        return true
                          Severity: Minor
                          Found in lib/applicat/mvc/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 thing= has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                                  def thing=(thing)
                                    thing.save if thing.new_record?
                                    
                                    self.thing_type = thing.class.name; self.thing_id = thing.id
                                    
                          Severity: Minor
                          Found in lib/concerns/model/base_list_item.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 name_valid? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def name_valid?
                              return unless name_changed?
                              
                              if name.present?
                                if Task.where(name: name, story_id: story_id).any?
                          Severity: Minor
                          Found in app/models/task.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 resource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                          Open

                            def resource
                              @task = Task.find(params[:id]) unless @task || !params[:id].present?
                              @story = @task.story unless @story || !@task
                              @project = @story.project
                              @task
                          Severity: Minor
                          Found in app/controllers/tasks_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

                          Severity
                          Category
                          Status
                          Source
                          Language