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
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
Class PresentationXMLConvert
has 27 methods (exceeds 20 allowed). Consider refactoring. Open
class PresentationXMLConvert < IsoDoc::PresentationXMLConvert
def initialize(options)
@hierarchical_assets = options[:hierarchicalassets]
super
end
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
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"))
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)
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)
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)
Method stylesmap
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stylesmap
{
example: "IEEEStdsParagraph",
MsoNormal: "IEEEStdsParagraph",
NormRef: "IEEEStdsParagraph",
Method stylesmap
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def stylesmap
{
example: "IEEEStdsParagraph", # x
MsoNormal: "MsoBodyText",
NormRef: "MsoBodyText",
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"]
- Read upRead up
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|
- Read upRead up
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")
- Read upRead up
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"
- Read upRead up
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")
- Read upRead up
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,
- Read upRead up
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
Method xref_init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def xref_init(lang, script, _klass, i18n, options)
Method output
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def output(isodoc_node, inname, outname, format, options = {})
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(lang, script, klass, labels, options)