metanorma/metanorma-ieee

View on GitHub

Showing 24 of 30 total issues

Class PresentationXMLConvert has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

    class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
      def multidef(elem)
        number_multidef(elem)
        collapse_multidef(elem)
      end
Severity: Minor
Found in lib/isodoc/ieee/presentation_terms.rb - About 4 hrs to fix

    Class Converter has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

        class Converter < Standoc::Converter
          def initial_boilerplate(xml, isodoc)
            intro_boilerplate(xml, isodoc)
            super if @document_scheme == "ieee-sa-2021"
            xml.at("//boilerplate") or return
    Severity: Minor
    Found in lib/metanorma/ieee/cleanup.rb - About 3 hrs to fix

      Class PresentationXMLConvert has 27 methods (exceeds 20 allowed). Consider refactoring.
      Open

          class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
            def initialize(options)
              @hierarchical_assets = options[:hierarchicalassets]
              super
            end
      Severity: Minor
      Found in lib/isodoc/ieee/presentation_xml_convert.rb - About 3 hrs to fix

        Class Converter has 27 methods (exceeds 20 allowed). Consider refactoring.
        Open

            class Converter < Standoc::Converter
              BIBLIO =
                "//bibliography/references[@normative = 'false'][not(@hidden)] | " \
                "//bibliography/clause[.//references[@normative = 'false']] | " \
                "//annex//references[@normative = 'false'][not(@hidden)]".freeze
        Severity: Minor
        Found in lib/metanorma/ieee/cleanup_ref.rb - About 3 hrs to fix

          Class Converter has 24 methods (exceeds 20 allowed). Consider refactoring.
          Open

              class Converter < Standoc::Converter
                def validate(doc)
                  content_validate(doc)
                  schema_validate(formattedstr_strip(doc.dup),
                                  File.join(File.dirname(__FILE__), "ieee.rng"))
          Severity: Minor
          Found in lib/metanorma/ieee/validate.rb - About 2 hrs to fix

            Class Converter has 23 methods (exceeds 20 allowed). Consider refactoring.
            Open

                class Converter < Standoc::Converter
                  def metadata_committee(node, xml)
                    metadata_committee_prep(node) or return
                    xml.editorialgroup do |a|
                      committee_component("society", node, a)
            Severity: Minor
            Found in lib/metanorma/ieee/front.rb - About 2 hrs to fix

              Class WordConvert has 23 methods (exceeds 20 allowed). Consider refactoring.
              Open

                  class WordConvert < IsoDoc::WordConvert
                    def authority_cleanup(docxml)
                      feedback_footnote(docxml)
                      %w(copyright license disclaimers participants).each do |t|
                        authority_cleanup1(docxml, t)
              Severity: Minor
              Found in lib/isodoc/ieee/word_authority.rb - About 2 hrs to fix

                Class WordConvert has 21 methods (exceeds 20 allowed). Consider refactoring.
                Open

                    class WordConvert < IsoDoc::WordConvert
                      def initialize(options)
                        @libdir = File.dirname(__FILE__)
                        super
                        init_wp(options.dup)
                Severity: Minor
                Found in lib/isodoc/ieee/word_convert.rb - About 2 hrs to fix

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

                        def stylesmap
                          {
                            example: "IEEEStdsParagraph",
                            MsoNormal: "IEEEStdsParagraph",
                            NormRef: "IEEEStdsParagraph",
                  Severity: Minor
                  Found in lib/isodoc/ieee/word_cleanup.rb - About 1 hr to fix

                    Method stylesmap has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          def stylesmap
                            {
                              example: "IEEEStdsParagraph", # x
                              MsoNormal: "MsoBodyText",
                              NormRef: "MsoBodyText",
                    Severity: Minor
                    Found in lib/isodoc/ieee/word_wp_cleanup.rb - About 1 hr to fix

                      Method style_list has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def style_list(elem, level, liststyle, listnumber)
                            return unless liststyle
                      
                            sameelem_level = elem.ancestors.map(&:name).count(elem.parent.name)
                            if elem["style"]
                      Severity: Minor
                      Found in lib/html2doc/ieee/lists.rb - About 1 hr 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 list2para has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def list2para(list)
                            list.name == "ol" and return super
                            return if list.xpath("./li").empty?
                      
                            list.xpath("./li/p").each do |p|
                      Severity: Minor
                      Found in lib/html2doc/ieee_wp/lists.rb - About 1 hr 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 list2para1 has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          def list2para1(list, level, type)
                            list.xpath("./li").first["class"] ||= list_style(type, level, "First")
                            list.xpath("./li").last["class"] ||= list_style(type, level, "Last")
                            list.xpath("./li/p").each do |p|
                              p["class"] ||= list_style(type, level, "Middle")
                      Severity: Minor
                      Found in lib/html2doc/ieee/lists.rb - About 55 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 std_docid_sdo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def std_docid_sdo(text)
                              found = false
                              text.split(%r{([\p{Zs}|/]+)}).reverse.map do |x|
                                if /[A-Za-z]/.match?(x)
                                  k = if found || agency?(x) then "std_publisher"
                      Severity: Minor
                      Found in lib/isodoc/ieee/init.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 onlychild_clause_validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def onlychild_clause_validate(root)
                              root.xpath(Standoc::Utils::SUBCLAUSE_XPATH).each do |c|
                                next unless c.xpath("../clause").size == 1
                      
                                title = c.at("./title")
                      Severity: Minor
                      Found in lib/metanorma/ieee/validate_section.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 listdepth_validate has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def listdepth_validate(doc)
                              doc.xpath("//ul[.//ul//ul]").each do |u|
                                next unless u.ancestors("ul").empty?
                      
                                @log.add("Style", u,
                      Severity: Minor
                      Found in lib/metanorma/ieee/validate.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

                      Consider simplifying this complex logical expression.
                      Open

                              if b = bib.at("./language | ./script | ./abstract | ./status")
                                b.previous = note
                              else b = bib.at("./contributor") || bib.at("./date") ||
                                bib.at("./docnumber") || bib.at("./docidentifier") ||
                                bib.at("./title") and b.next = note
                      Severity: Major
                      Found in lib/metanorma/ieee/cleanup_ref.rb - About 40 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/ieee/init.rb - About 35 mins to fix

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

                                def output(isodoc_node, inname, outname, format, options = {})
                          Severity: Minor
                          Found in lib/metanorma/ieee/processor.rb - About 35 mins to fix

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

                                  def initialize(lang, script, klass, labels, options)
                            Severity: Minor
                            Found in lib/isodoc/ieee/xref.rb - About 35 mins to fix
                              Severity
                              Category
                              Status
                              Source
                              Language