MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Function handler has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        handleObj.handler = function( event ) {
            // Don't fire in text-accepting inputs that we didn't directly bind to
            if ( this !== event.target && (/textarea|select/i.test( event.target.nodeName ) ||
                 event.target.type === "text") ) {
                return;
Severity: Minor
Found in app/assets/javascripts/jquery.hotkeys.js - About 1 hr to fix

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

      def request_summary
        return nil unless @record
    
        {
          :subject_heading => @record['TR'].try(:[], 'TRD'),
    Severity: Minor
    Found in app/models/nacsis_cat.rb - About 1 hr to fix

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

        def destroy
          obj = @picture_file.picture_attachable
          case
          when @picture_file.picture_attachable.is_a?(Shelf)
            type = 'Shelf'
      Severity: Minor
      Found in app/controllers/picture_files_controller.rb - About 1 hr to fix

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

          def check_status
            if self.all_process_start_at
        
              if self.all_process_end_at
                self.set_all_process_end
        Severity: Minor
        Found in app/models/approval.rb - About 1 hr to fix

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

                def to_params
                  params = { :q => @keywords }
                  params[:fl] = '* score'
                  params[:qf] = @fulltext_fields.values.map { |field| field.to_boosted_field }.join(' ')
                  params[:defType] = 'edismax'
          Severity: Minor
          Found in lib/plugins/ext/sunspot/dismax.rb - About 1 hr to fix

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

                def advanced_search_merge_tag(name, type = nil)
                  pname = :"#{name}_merge"
                  all = any = exact = startwith = false
            
                  case params[pname]
            Severity: Minor
            Found in lib/enju_trunk/enju_trunk_helper.rb - About 1 hr to fix

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

                def install_migrations
                  if File.exist?("#{EnjuTrunk::Engine.root.to_s}/db/schema.rb")
                    copy_file "#{EnjuTrunk::Engine.root.to_s}/db/schema.rb", 'db/schema.rb'
                    main_path = Rails.root.to_s
                    %w(
              Severity: Minor
              Found in lib/generators/enju_trunk/install/install_generator.rb - About 1 hr to fix

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

                  def create
                    @own = Own.new(params[:own])
                
                    respond_to do |format|
                      if @own.save
                Severity: Major
                Found in app/controllers/owns_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @picture_file = PictureFile.new(params[:picture_file])
                
                    respond_to do |format|
                      if @picture_file.save
                Severity: Major
                Found in app/controllers/picture_files_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @user_group = UserGroup.new(params[:user_group])
                
                    respond_to do |format|
                      if @user_group.save
                Severity: Major
                Found in app/controllers/user_groups_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54

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

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

                  def create
                    @realize = Realize.new(params[:realize])
                
                    respond_to do |format|
                      if @realize.save
                Severity: Major
                Found in app/controllers/realizes_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @donate = Donate.new(params[:donate])
                
                    respond_to do |format|
                      if @donate.save
                Severity: Major
                Found in app/controllers/donates_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @tax_rate = TaxRate.new(params[:tax_rate])
                
                    respond_to do |format|
                      if @tax_rate.save
                Severity: Major
                Found in app/controllers/tax_rates_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @identifier_type = IdentifierType.new(params[:identifier_type])
                
                    respond_to do |format|
                      if @identifier_type.save
                Severity: Major
                Found in app/controllers/identifier_types_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @create = Create.new(params[:create])
                
                    respond_to do |format|
                      if @create.save
                Severity: Major
                Found in app/controllers/creates_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @subscribe = Subscribe.new(params[:subscribe])
                
                    respond_to do |format|
                      if @subscribe.save
                Severity: Major
                Found in app/controllers/subscribes_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/produces_controller.rb on lines 57..66
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

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

                  def create
                    @produce = Produce.new(params[:produce])
                
                    respond_to do |format|
                      if @produce.save
                Severity: Major
                Found in app/controllers/produces_controller.rb and 9 other locations - About 1 hr to fix
                app/controllers/creates_controller.rb on lines 52..61
                app/controllers/donates_controller.rb on lines 42..51
                app/controllers/identifier_types_controller.rb on lines 41..50
                app/controllers/owns_controller.rb on lines 53..62
                app/controllers/picture_files_controller.rb on lines 114..123
                app/controllers/realizes_controller.rb on lines 52..61
                app/controllers/subscribes_controller.rb on lines 45..54
                app/controllers/tax_rates_controller.rb on lines 45..54
                app/controllers/user_groups_controller.rb on lines 54..63

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

                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

                  def update
                    @budget = Budget.find(params[:id])
                
                    respond_to do |format|
                      if @budget.update_attributes(params[:budget])
                Severity: Major
                Found in app/controllers/budgets_controller.rb and 1 other location - About 1 hr to fix
                app/controllers/expenses_controller.rb on lines 15..26

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

                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

                  def update
                    @expense = Expense.find(params[:id])
                
                    respond_to do |format|
                      if @expense.update_attributes(params[:expense])
                Severity: Major
                Found in app/controllers/expenses_controller.rb and 1 other location - About 1 hr to fix
                app/controllers/budgets_controller.rb on lines 39..50

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

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

                    _checkOffset: function(inst, offset, isFixed) {
                        var pos = inst._input ? this._findPos(inst._input[0]) : null;
                        var browserWidth = window.innerWidth || document.documentElement.clientWidth;
                        var browserHeight = window.innerHeight || document.documentElement.clientHeight;
                        var scrollX = document.documentElement.scrollLeft || document.body.scrollLeft;
                Severity: Minor
                Found in app/assets/javascripts/jquery.keypad.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language