-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coradoc integration #92
Conversation
* coradoc integration --------- Co-authored-by: Ronald Tse <[email protected]>
|
||
u_before = unconstrained_before?(node) | ||
u_after = unconstrained_after?(node) | ||
u = !((!u_before || has_leading_whitespace) && (!u_after || has_trailing_whitespace)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [93/80]
content | ||
else | ||
"#{content[/^\s*/]}_#{content.strip}_#{content[/\s*$/]}" | ||
def to_coradoc(node, state = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for to_coradoc is too high. [<13, 29, 7> 32.54/15]
Cyclomatic complexity for to_coradoc is too high. [8/6]
Method has too many lines. [31/10]
Perceived complexity for to_coradoc is too high. [8/7]
width = node['width'] | ||
height = node['height'] | ||
anchor = id ? "[[#{id}]]\n" : "" | ||
def to_coradoc(node, _state = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for to_coradoc is too high. [<8, 15, 6> 18.03/15]
Cyclomatic complexity for to_coradoc is too high. [7/6]
Method has too many lines. [22/10]
Perceived complexity for to_coradoc is too high. [8/7]
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub(/\(\(([^\)]+)\)\)/, "(\\1)") unless stem.nil? | ||
unless stem.nil? | ||
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub( | ||
/\(\(([^\)]+)\)\)/, "(\\1)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Redundant escape inside regexp literal
else | ||
nil | ||
end | ||
case node["style"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing case-when with a hash lookup.
id = node['id'] | ||
anchor = id ? "[[#{id}]]" : "" | ||
colrowattr = colrow(node['colspan'], node['rowspan']) | ||
def to_coradoc(node, state = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Assignment Branch Condition size for to_coradoc is too high. [<18, 24, 8> 31.05/15]
Cyclomatic complexity for to_coradoc is too high. [7/6]
Method has too many lines. [20/10]
then input.root | ||
elsif input.is_a?(Nokogiri::XML::Node) | ||
then input | ||
def self.to_coradoc(input, options = {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method has too many lines. [12/10]
is_expected.to include " link <<content,internal jumplinks>> with anchors " | ||
} | ||
it { | ||
is_expected.to include " link <<content2>>internal jumplinks without anchors " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
it { is_expected.to include ' link <<content2>>internal jumplinks without anchors ' } | ||
it { is_expected.to include ' treat [[content]] as bookmarks ' } | ||
it { | ||
is_expected.to include " do not ignore link:foo.html[] anchor tags with no link text " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [90/80]
|
||
it { is_expected.to include 'There should be space before but not after the anchor ( http://foobar.com[stripped]).' } | ||
it { | ||
is_expected.to include "There should be space before but not after the anchor ( http://foobar.com[stripped])." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [114/80]
string | ||
.gsub(/((?<=\s)[\*_]+)|[\*_]+(?=\s)/) { |n| n.chars.map { |char| subs[char] }.join } | ||
.gsub(/((?<=\s)[\*_]+)|[\*_]+(?=\s)/) do |n| | ||
n.chars.map do |char| | ||
subs[char] | ||
end.join | ||
end |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
This
regular expression
library input
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub( | ||
/\(\(([^\)]+)\)\)/, "(\\1)" | ||
) |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
library input
This
regular expression
library input
end | ||
|
||
def language_from_confluence_class(node) | ||
node['class'].to_s[/brush:\s?(:?.*);/, 1] | ||
node["class"].to_s[/brush:\s?(:?.*);/, 1] |
Check failure
Code scanning / CodeQL
Polynomial regular expression used on uncontrolled data High
regular expression
library input
This
regular expression
library input
stem = node.to_s.gsub(/\n/, " ") | ||
stem = MathML2AsciiMath.m2a(stem) if ReverseAdoc.config.mathml2asciimath | ||
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub(/\(\(([^\)]+)\)\)/, "(\\1)") unless stem.nil? | ||
unless stem.nil? | ||
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub( |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
stem = node.to_s.gsub(/\n/, " ") | ||
stem = MathML2AsciiMath.m2a(stem) if ReverseAdoc.config.mathml2asciimath | ||
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub(/\(\(([^\)]+)\)\)/, "(\\1)") unless stem.nil? | ||
unless stem.nil? | ||
stem = stem.gsub(/\[/, "\\[").gsub(/\]/, "\\]").gsub( |
Check failure
Code scanning / CodeQL
Incomplete string escaping or encoding High
@xyz65535 for additional issues please help use a new PR. Thanks. |
From @xyz65535