metanorma/metanorma-bipm

View on GitHub
lib/isodoc/bipm/presentation_xml_convert.rb

Summary

Maintainability
B
5 hrs
Test Coverage

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

    class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
      def convert1(docxml, filename, dir)
        @jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
                              "@acronym"))&.value == "JCGM"
        @xrefs.klass.jcgm = @jcgm
Severity: Minor
Found in lib/isodoc/bipm/presentation_xml_convert.rb - About 3 hrs to fix

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

          def norm_ref_entry_code(_ordinal, identifiers, _ids, _standard, datefn,
    _bib)
    Severity: Minor
    Found in lib/isodoc/bipm/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/bipm/presentation_xml_convert.rb - About 45 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}[not(@type = 'quoted')]"))
                  node.at(ns("./#{elem}[@type = 'quoted']")) and return
                  (node.children.empty? and node.add_child("<#{elem}></#{elem}>")) or
        Severity: Minor
        Found in lib/isodoc/bipm/presentation_xml_convert.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

        There are no issues that match your filters.

        Category
        Status