metanorma/isodoc

View on GitHub

Showing 70 of 112 total issues

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

      def quote_attribution(node, out)
        author = node.at(ns("./author"))
        source = node.at(ns("./source"))
        return if author.nil? && source.nil?

Severity: Minor
Found in lib/isodoc/function/blocks.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 list_item_anchor_names has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

      def list_item_anchor_names(list, list_anchor, depth, prev_label, refer_list)
Severity: Minor
Found in lib/isodoc/xref/xref_gen.rb - About 35 mins to fix

    Method preface_move1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def preface_move1(clause, preface, float, prev, xpath)
    Severity: Minor
    Found in lib/isodoc/presentation_function/section.rb - About 35 mins to fix

      Method swap_renderer has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def swap_renderer(oldklass, newklass, file, input_filename, debug)
      Severity: Minor
      Found in lib/isodoc/convert.rb - About 35 mins to fix

        Method make_tr_attr has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

              def make_tr_attr(cell, row, totalrows, header, bordered)
        Severity: Minor
        Found in lib/isodoc/word_function/table.rb - About 35 mins to fix

          Method make_tr_attr_style has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                def make_tr_attr_style(row, rowmax, totalrows, _header, bordered)
          Severity: Minor
          Found in lib/isodoc/function/table.rb - About 35 mins to fix

            Method hierarchical_permission_body has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                  def hierarchical_permission_body(id, block, label, klass, model)
            Severity: Minor
            Found in lib/isodoc/xref/xref_gen_seq.rb - About 35 mins to fix

              Method make_tr_attr_style has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                    def make_tr_attr_style(cell, row, rowmax, totalrows, opt)
              Severity: Minor
              Found in lib/isodoc/word_function/table.rb - About 35 mins to fix

                Method make_tr_attr has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                      def make_tr_attr(cell, row, totalrows, header, bordered)
                Severity: Minor
                Found in lib/isodoc/function/table.rb - About 35 mins to fix

                  Method anchor_struct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        def anchor_struct(lbl, container, elem, type, unnumb = false)
                  Severity: Minor
                  Found in lib/isodoc/xref/xref_anchor.rb - About 35 mins to fix

                    Method xref_init has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def xref_init(lang, script, _klass, i18n, options)
                    Severity: Minor
                    Found in lib/isodoc/init.rb - About 35 mins to fix

                      Method clause_parse_title has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                            def clause_parse_title(node, div, title, out, header_class = {})
                      Severity: Minor
                      Found in lib/isodoc/function/section_titles.rb - About 35 mins to fix

                        Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            def initialize(lang, script, klass, i18n, options = {})
                        Severity: Minor
                        Found in lib/isodoc/xref.rb - About 35 mins to fix

                          Method hierarchical_figure_body has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                def hierarchical_figure_body(num, subfignum, counter, block, klass)
                          Severity: Minor
                          Found in lib/isodoc/xref/xref_gen_seq.rb - About 35 mins to fix

                            Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                def initialize(lang, script, locale, i18n, fonts_options = {})
                            Severity: Minor
                            Found in lib/isodoc/metadata.rb - About 35 mins to fix

                              Method tr_parse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                    def tr_parse(node, out, ord, totalrows, header)
                              Severity: Minor
                              Found in lib/isodoc/function/table.rb - About 35 mins to fix

                                Method sequential_permission_body has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                      def sequential_permission_body(id, elem, label, klass, model, container: false)
                                Severity: Minor
                                Found in lib/isodoc/xref/xref_gen_seq.rb - About 35 mins to fix

                                  Method clause_parse_title1 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                        def clause_parse_title1(node, div, title, _out, header_class = {})
                                  Severity: Minor
                                  Found in lib/isodoc/function/section_titles.rb - About 35 mins to fix

                                    Method prefix_name has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        def prefix_name(node, delim, number, elem)
                                          number.nil? || number.empty? and return
                                          unless name = node.at(ns("./#{elem}"))
                                            (node.children.empty? and node.add_child("<#{elem}></#{elem}>")) or
                                              node.children.first.previous = "<#{elem}></#{elem}>"
                                    Severity: Minor
                                    Found in lib/isodoc/presentation_function/block.rb - About 35 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 subsequence_increment has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                          def subsequence_increment(node)
                                            return increment_letter unless node["number"]
                                    
                                            @base = ""
                                            @letter_override = node["number"]
                                    Severity: Minor
                                    Found in lib/isodoc/xref/xref_counter.rb - About 35 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