polichombr/analysis_tools/beautysvg.rb
parse_calls doesn't depend on instance state (maybe move it to another class?) Open
Open
def parse_calls(datas, regexp)
- Read upRead up
- Exclude checks
A Utility Function is any instance method that has no dependency on the state of the instance.
Use ==
if you meant to do a comparison or wrap the expression in parentheses to indicate you meant to assign in a condition. Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#\" stroke-width=\"0.7\" stroke=\"red\" fill=\"red\">#{call_stub.split('(')[0]}<!-- --></a>(#{call_stub.split('(')[1]}")
- Read upRead up
- Exclude checks
This cop checks for assignments in the conditions of if/while/until.
Example:
# bad
if some_var = true
do_something
end
Example:
# good
if some_var == true
do_something
end
Line is too long. [317/80] Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#{call_stub.split('loc_')[1].split('h')[0]}\" stroke-width=\"0.7\" stroke=\"blue\" fill=\"blue\">#{call_stub}</a><a xlink:href=\"javascript:displayRenameBox(0x#{(call_stub.scan(/[a-f0-9]{3,}/))[1]});\" stroke-width=\"0.6\" stroke=\"#80c000\" fill=\"#80c000\">[R]</a>")
- Exclude checks
Don't use parentheses around a method call. Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#{call_stub.split('loc_')[1].split('h')[0]}\" stroke-width=\"0.7\" stroke=\"blue\" fill=\"blue\">#{call_stub}</a><a xlink:href=\"javascript:displayRenameBox(0x#{(call_stub.scan(/[a-f0-9]{3,}/))[1]});\" stroke-width=\"0.6\" stroke=\"#80c000\" fill=\"#80c000\">[R]</a>")
- Read upRead up
- Exclude checks
This cop checks for redundant parentheses.
Example:
# bad
(x) if ((y.z).nil?)
# good
x if y.z.nil?
Space missing after comma. Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#{call_stub.split('_at_0x')[1].split('_')[0]}\" stroke-width=\"0.7\" stroke=\"blue\" fill=\"blue\">#{call_stub.split('_at_0x')[0].gsub('_','_<!-- -->')}</a><a xlink:href=\"javascript:displayRenameBox(0x#{call_stub.split('_at_0x')[1].split('_')[0]});\" stroke-width=\"0.6\" stroke=\"#80c000\" fill=\"#80c000\">[R]</a>")
- Read upRead up
- Exclude checks
Checks for comma (,) not followed by some kind of space.
Example:
# bad
[1,2]
{ foo:bar,}
# good
[1, 2]
{ foo:bar, }
Line is too long. [367/80] Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#{call_stub.split('_at_0x')[1].split('_')[0]}\" stroke-width=\"0.7\" stroke=\"blue\" fill=\"blue\">#{call_stub.split('_at_0x')[0].gsub('_','_<!-- -->')}</a><a xlink:href=\"javascript:displayRenameBox(0x#{call_stub.split('_at_0x')[1].split('_')[0]});\" stroke-width=\"0.6\" stroke=\"#80c000\" fill=\"#80c000\">[R]</a>")
- Exclude checks
Line is too long. [128/80] Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#\" stroke-width=\"0.6\" stroke=\"#c00000\" fill=\"#c00000\">#{call_stub}</a>")
- Exclude checks
Line is too long. [367/80] Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#{call_stub.split('_at_0x')[1].split('_')[0]}\" stroke-width=\"0.7\" stroke=\"blue\" fill=\"blue\">#{call_stub.split('_at_0x')[0].gsub('_','_<!-- -->')}</a><a xlink:href=\"javascript:displayRenameBox(0x#{call_stub.split('_at_0x')[1].split('_')[0]});\" stroke-width=\"0.6\" stroke=\"#80c000\" fill=\"#80c000\">[R]</a>")
- Exclude checks
Line is too long. [145/80] Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#\" stroke-width=\"0.7\" stroke=\"red\" fill=\"red\">#{call_stub.gsub('_', '_<!-- -->')}</a>")
- Exclude checks
Line is too long. [169/80] Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#\" stroke-width=\"0.7\" stroke=\"red\" fill=\"red\">#{call_stub.split('(')[0]}<!-- --></a>(#{call_stub.split('(')[1]}")
- Exclude checks
Space missing after comma. Open
Open
datas = datas.gsub(call_stub, "<a xlink:href=\"#{call_stub.split('_at_0x')[1].split('_')[0]}\" stroke-width=\"0.7\" stroke=\"blue\" fill=\"blue\">#{call_stub.split('_at_0x')[0].gsub('_','_<!-- -->')}</a><a xlink:href=\"javascript:displayRenameBox(0x#{call_stub.split('_at_0x')[1].split('_')[0]});\" stroke-width=\"0.6\" stroke=\"#80c000\" fill=\"#80c000\">[R]</a>")
- Read upRead up
- Exclude checks
Checks for comma (,) not followed by some kind of space.
Example:
# bad
[1,2]
{ foo:bar,}
# good
[1, 2]
{ foo:bar, }