MiraitSystems/enju_trunk

View on GitHub

Showing 1,155 of 1,155 total issues

Avoid deeply nested control flow statements.
Open

                    if (toolTip)
                        cell.title = toolTip;
Severity: Major
Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                    switch (K) {
                        case 37: // KEY left
                        if (--x >= 0)
                            ne = cal.ar_days[y][x];
                        else {
    Severity: Major
    Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

      Function pxToEm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
          //set defaults
          settings = $.extend({
              scope: 'body',
              reverse: false
      Severity: Minor
      Found in app/assets/javascripts/fg.menu.js - 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 import! has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

        def import!
          logger.info "import start"
          unless manifestation
            manifestation = self.class.import_isbn(isbn)
            if manifestation
      Severity: Minor
      Found in app/models/import_request.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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def initialize(job_name, file_name, file_type, method, args, user)
      Severity: Minor
      Found in app/models/item.rb - About 45 mins to fix

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

          def self.export_item_register(type, out_dir, file_type = nil)
            raise "invalid parameter: no path" if out_dir.nil? || out_dir.length < 1
            tsv_file = out_dir + "item_register_#{type}.tsv"
            pdf_file = out_dir + "item_register_#{type}.pdf"
            logger.info "output item_register_#{type} tsv: #{tsv_file} pdf: #{pdf_file}"
        Severity: Minor
        Found in app/models/item.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 make_export_item_list_job has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          def self.make_export_item_list_job(file_name, file_type, method, dumped_query, args, user)
        Severity: Minor
        Found in app/models/item.rb - About 45 mins to fix

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

            def check_hankaku?(str)
              str.split("").each do |spelling|
                # 半角小文字か
                if check_hankaku_small_string?(spelling) then
                  next
          Severity: Minor
          Found in app/models/abbreviation.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

          Function drilldown has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          Menu.prototype.drilldown = function(container, options) {
              var menu = this;    
              var topList = container.find('.fg-menu');    
              var breadcrumb = $('<ul class="fg-menu-breadcrumb ui-widget-header ui-corner-all ui-helper-clearfix"></ul>');
              var crumbDefaultHeader = $('<li class="fg-menu-breadcrumb-text">'+options.crumbDefaultText+'</li>');
          Severity: Minor
          Found in app/assets/javascripts/fg.menu.js - 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 initialize has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def initialize(name, fileinfo, output_type, user, search_condition_summary, cols)
          Severity: Minor
          Found in app/models/manifestation.rb - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if (!ne.disabled)
                                Calendar.cellClick(ne);
                            else if (prev)
                                prevMonth();
                            else
            Severity: Major
            Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

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

                def check_rank
                  if self.manifestation_type && self.manifestation_type.is_article?
                    if self.items and self.items.size > 0
                      unless self.items.map{ |item| item.rank.to_i }.compact.include?(0)
                        errors[:base] << I18n.t('manifestation.not_has_original')
              Severity: Minor
              Found in app/models/manifestation.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

              Avoid deeply nested control flow statements.
              Open

                                  if (/disabled/i.test(status))
                                      cell.disabled = true;
              Severity: Major
              Found in app/assets/javascripts/jquery.simplecalendarjp.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                  row << item.manifestation.date_of_publication.strftime("%Y/%m/%d") rescue ""
                Severity: Major
                Found in app/models/item.rb - About 45 mins to fix

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

                      def batch_create_from_ncid(ncids, opts = {}, &block)
                        nacsis_batch_size = opts[:nacsis_batch_size] || 50
                  
                        ncids.each_slice(nacsis_batch_size) do |ids|
                          result = NacsisCat.search(dbs: [:all], id: ids)
                  Severity: Minor
                  Found in app/models/nacsis_cat.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 output_catalog has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def self.output_catalog(type, out_dir, file_type = nil)
                      raise "invalid parameter: no path" if out_dir.nil? || out_dir.length < 1
                      pdf_file = out_dir + "#{type}_catalog.pdf"
                      logger.info "output #{type}_catalog  pdf: #{pdf_file}"
                  FileUtils.mkdir_p(out_dir) unless FileTest.exist?(out_dir)
                  Severity: Minor
                  Found in app/models/item.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 value_by_typename_is_valid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def value_by_typename_is_valid
                      case typename
                      when "Text"
                      when "String"
                      when "Boolean"
                  Severity: Minor
                  Found in app/models/system_configuration.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 check_ordered? has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                  Open

                    def check_ordered?
                      unless order
                        if item.present?
                          errors[:base] << I18n.t('accept.no_ordered')
                          return false
                  Severity: Minor
                  Found in app/models/accept.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

                  Avoid deeply nested control flow statements.
                  Open

                              next_issue = 1 if self.issue_param
                  Severity: Major
                  Found in app/models/sequence_pattern.rb - About 45 mins to fix

                    Method output_detail has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      def self.output_detail(wbstyles, sheet, data, conditions, cols, remove = nil)
                    Severity: Minor
                    Found in app/models/item_statistics.rb - About 45 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language