volontariat/voluntary

View on GitHub

Showing 242 of 242 total issues

Function updateDate has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function updateDate(d, params, reset, advance, prefer, weekdayForward) {
    var specificityIndex;

    function getParam(key) {
      return isDefined(params[key]) ? params[key] : params[key + 's'];
Severity: Major
Found in app/assets/javascripts/voluntary/lib/sugar.js - About 2 hrs to fix

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

            var itemsAfter = list.find('.' + settings.selectedClass).filter(function() {
              return $(this).data('i') > myIndex
            }).css({
                position: '',
                width: '',
    Severity: Major
    Found in app/assets/javascripts/voluntary/lib/jquery.multisortable.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/voluntary/lib/jquery.multisortable.js on lines 125..133

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

    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

            var itemsBefore = list.find('.' + settings.selectedClass).filter(function() {
              return $(this).data('i') < myIndex
            }).css({
                position: '',
                width: '',
    Severity: Major
    Found in app/assets/javascripts/voluntary/lib/jquery.multisortable.js and 1 other location - About 2 hrs to fix
    app/assets/javascripts/voluntary/lib/jquery.multisortable.js on lines 137..145

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

    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 included has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.included(base)
        base.extend ClassMethods
        
        base.class_eval do
          include Model::MongoDb::StateVersionAttributes
    Severity: Major
    Found in app/models/state_machines/task.rb - About 2 hrs to fix

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

      Then /^the "([^"]*)" field should have the error "([^"]*)"$/ do |field, error_message|
        element = find_field(field)
        classes = element.find(:xpath, '..')[:class].split(' ')
      
        form_for_input = element.find(:xpath, 'ancestor::form[1]')
      dummy/features/step_definitions/web_steps.rb on lines 182..208
      lib/generators/voluntary/install/templates/features/step_definitions/web_steps.rb on lines 182..208

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

      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

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

      Then /^the "([^"]*)" field should have the error "([^"]*)"$/ do |field, error_message|
        element = find_field(field)
        classes = element.find(:xpath, '..')[:class].split(' ')
      
        form_for_input = element.find(:xpath, 'ancestor::form[1]')
      dummy/features/step_definitions/web_steps.rb on lines 182..208
      lib/generators/voluntary/product_dummy/templates/features/step_definitions/web_steps.rb on lines 182..208

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

      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

      Identical blocks of code found in 3 locations. Consider refactoring.
      Open

      Then /^the "([^"]*)" field should have the error "([^"]*)"$/ do |field, error_message|
        element = find_field(field)
        classes = element.find(:xpath, '..')[:class].split(' ')
      
        form_for_input = element.find(:xpath, 'ancestor::form[1]')
      Severity: Major
      Found in dummy/features/step_definitions/web_steps.rb and 2 other locations - About 2 hrs to fix
      lib/generators/voluntary/install/templates/features/step_definitions/web_steps.rb on lines 182..208
      lib/generators/voluntary/product_dummy/templates/features/step_definitions/web_steps.rb on lines 182..208

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

      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

      Function moveCompetitorToPosition has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            CompetitiveList.prototype.moveCompetitorToPosition = function(competitorId, position, after_update_request_proc) {
              var defeatedCompetitor, outmatchedCompetitor, positionOfdefeatedCompetitor, positions;
              if (after_update_request_proc == null) {
                after_update_request_proc = null;
              }
      Severity: Major
      Found in app/assets/javascripts/voluntary/lib/jquery-competitive_list.js - About 2 hrs to fix

        Method included has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                def self.included(base)
                  base.class_eval do
                    has_ancestry :cache_depth => true, :orphan_strategy => :rootify
        
                    acts_as_list
        Severity: Major
        Found in lib/applicat/mvc/model/tree.rb - About 2 hrs to fix

          File navigation.rb has 267 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          module Voluntary
            module Navigation
              class Base
                @@products = {}
                @@core_menus = [:areas, :products, :organizations, :projects, :users, :workflow, :authentication]
          Severity: Minor
          Found in lib/voluntary/navigation.rb - About 2 hrs to fix

            Function runTagReplacements has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function runTagReplacements(str, reg, strip, replacementFn, fullString) {
            
                var match;
                var result = '';
                var currentIndex = 0;
            Severity: Major
            Found in app/assets/javascripts/voluntary/lib/sugar.js - About 2 hrs to fix

              Function api has 59 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function api (key, value, attributes) {
                    var result;
              
                    // Write
              
              
              Severity: Major
              Found in app/assets/javascripts/voluntary/lib/jquery.cookie.js - About 2 hrs to fix

                Method included has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def self.included(base)
                    base.extend ClassMethods
                    
                    base.class_eval do
                      include Model::MongoDb::StateVersionAttributes
                Severity: Major
                Found in app/models/state_machines/story.rb - About 2 hrs to fix

                  Method included has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                  Open

                            def self.included(base)
                              base.class_eval do
                                cattr_reader :per_page
                                @@per_page = 20
                    
                  Severity: Minor
                  Found in lib/applicat/mvc/model/resource/base.rb - About 2 hrs 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

                  Function addFormat has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      addFormat: function(src, allowsTime, match, variant, iso) {
                        var to = match || [], loc = this, time, timeMarkers, lastIsNumeral;
                  
                        src = src.replace(/\s+/g, '[,. ]*');
                        src = src.replace(/\{([^,]+?)\}/g, function(all, k) {
                  Severity: Major
                  Found in app/assets/javascripts/voluntary/lib/sugar.js - About 2 hrs to fix

                    Function every has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        'every': function(amount, fn) {
                          var increment,
                              precision,
                              dio,
                              unit,
                    Severity: Minor
                    Found in app/assets/javascripts/voluntary/lib/sugar.js - About 1 hr to fix

                      Function mouseDown has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function mouseDown(e) {
                            var item = $(this),
                              parent = item.parent(),
                              myIndex = item.index();
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/voluntary/lib/jquery.multisortable.js - About 1 hr to fix

                        Method gem_dependencies has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                              def gem_dependencies
                                create_file 'Gemfile', ''
                                
                                append_file 'Gemfile', :verbose => true do
                                  <<-EOH
                        Severity: Minor
                        Found in lib/generators/voluntary/product_dummy/product_dummy_generator.rb - About 1 hr to fix

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

                          class AppConfig < Settingslogic
                            def self.source_file_name
                              if ENV['application_yml'].present?
                                puts "using remote application.yml"
                                return ENV['application_yml']
                          dummy/app/models/app_config.rb on lines 7..31

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

                          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

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

                          class AppConfig < Settingslogic
                            def self.source_file_name
                              if ENV['application_yml'].present?
                                puts "using remote application.yml"
                                return ENV['application_yml']
                          Severity: Major
                          Found in dummy/app/models/app_config.rb and 1 other location - About 1 hr to fix
                          lib/generators/voluntary/install/templates/app/models/app_config.rb on lines 7..31

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

                          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