metanorma/metanorma-ogc

View on GitHub

Showing 14 of 14 total issues

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

    class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
      def initialize(options)
        @libdir = File.dirname(__FILE__)
        super
      end
Severity: Minor
Found in lib/isodoc/ogc/presentation_xml_convert.rb - About 4 hrs to fix

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

        class Converter < Standoc::Converter
          XML_ROOT_TAG = "ogc-standard".freeze
          XML_NAMESPACE = "https://www.metanorma.org/ns/ogc".freeze
    
          register_for "ogc"
    Severity: Minor
    Found in lib/metanorma/ogc/converter.rb - About 3 hrs to fix

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

          class Converter < Standoc::Converter
            def boilerplate_file(_xmldoc)
              File.join(@libdir, "boilerplate.adoc")
            end
      
      
      Severity: Minor
      Found in lib/metanorma/ogc/cleanup.rb - About 3 hrs to fix

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

            class Converter < Standoc::Converter
              def metadata_author(node, xml)
                corporate_author(node, xml)
                personal_author(node, xml)
              end
        Severity: Minor
        Found in lib/metanorma/ogc/front.rb - About 2 hrs to fix

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

              class HtmlConvert < IsoDoc::HtmlConvert
                def initialize(options)
                  @libdir = File.dirname(__FILE__)
                  super
                end
          Severity: Minor
          Found in lib/isodoc/ogc/html_convert.rb - About 2 hrs to fix

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

                  def norm_ref_entry_code(_ordinal, _idents, _ids, _standard, _datefn, _bib)
            Severity: Minor
            Found in lib/isodoc/ogc/presentation_xml_convert.rb - About 45 mins to fix

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

                    def biblio_ref_entry_code(ordinal, ids, _id, standard, datefn, _bib)
              Severity: Minor
              Found in lib/isodoc/ogc/presentation_xml_convert.rb - About 45 mins to fix

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

                      def metadata_subdoctype(node, xml)
                        s = node.attr("docsubtype")
                        s1 = ::IsoDoc::Ogc::DOCSUBTYPE_ABBR.invert[s] and s = s1
                        case doctype(node)
                        when "standard"
                Severity: Minor
                Found in lib/metanorma/ogc/front.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 has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

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

                        def xref_init(lang, script, _klass, labels, options)
                  Severity: Minor
                  Found in lib/isodoc/ogc/init.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/ogc/base_convert.rb - About 35 mins to fix

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

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

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

                              def obligations_cleanup_inherit(xml)
                                xml.xpath("//annex").each do |r|
                                  r["obligation"] = "informative" unless r["obligation"]
                                end
                                xml.xpath("//clause[not(ancestor::boilerplate)]").each do |r|
                        Severity: Minor
                        Found in lib/metanorma/ogc/cleanup.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 set_obligation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                              def set_obligation(attrs, node)
                                if node.attr("style") == "appendix" && node.level == 1
                                  attrs[:obligation] = if node.attributes.has_key?("obligation")
                                                         node.attr("obligation")
                                                       else "informative"
                        Severity: Minor
                        Found in lib/metanorma/ogc/converter.rb - About 25 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