ANSSI-FR/polichombr

View on GitHub
polichombr/analysis_tools/beautysvg.rb

Summary

Maintainability
A
0 mins
Test Coverage

parse_calls doesn't depend on instance state (maybe move it to another class?)
Open

def parse_calls(datas, regexp)
Severity: Minor
Found in polichombr/analysis_tools/beautysvg.rb by reek

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

  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]}")

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

  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>")

Don't use parentheses around a method call.
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>")

This cop checks for redundant parentheses.

Example:

# bad
(x) if ((y.z).nil?)

# good
x if y.z.nil?

Space missing after comma.
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>")

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

  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>")

Line is too long. [128/80]
Open

  datas = datas.gsub(call_stub, "<a xlink:href=\"#\" stroke-width=\"0.6\" stroke=\"#c00000\" fill=\"#c00000\">#{call_stub}</a>")

Line is too long. [367/80]
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>")

Line is too long. [145/80]
Open

    datas = datas.gsub(call_stub, "<a xlink:href=\"#\" stroke-width=\"0.7\" stroke=\"red\" fill=\"red\">#{call_stub.gsub('_', '_<!-- -->')}</a>")

Line is too long. [169/80]
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]}")

Space missing after comma.
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>")

Checks for comma (,) not followed by some kind of space.

Example:

# bad
[1,2]
{ foo:bar,}

# good
[1, 2]
{ foo:bar, }

There are no issues that match your filters.

Category
Status