ANSSI-FR/polichombr

View on GitHub

Showing 1,243 of 1,244 total issues

Line is too long. [136/80]
Open

      comment += " loc_#{dasm.normalize(di.instruction.args.last).to_s(16)}h_at_0x#{dasm.normalize(di.instruction.args.last).to_s(16)}_"

Line is too long. [92/80]
Open

      if !defined?(di.block) || (dasm.di_at(di.next_addr) && (di.opcode.name != 'jmp')).nil?

Line is too long. [84/80]
Open

        elsif (di.block.list.last.address == di.address) && !di.block.to_normal.nil?

Line is too long. [109/80]
Open

            fd.puts '        "0x' + curblock.to_s(16) + '" -> "0x' + dest_addr.to_s(16) + '" [color="blue"];'

Use snake_case for variable names.
Open

      argStr = dasm.decode_wstrz(di.instruction.args.last)

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Use @glinestree.zero? instead of @glinestree == 0.
Open

    log('    [...]') if @glinestree == 0

This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

Example: EnforcedStyle: predicate (default)

# bad

foo == 0
0 > foo
bar.baz > 0

# good

foo.zero?
foo.negative?
bar.baz.positive?

Example: EnforcedStyle: comparison

# bad

foo.zero?
foo.negative?
bar.baz.positive?

# good

foo == 0
0 > foo
bar.baz > 0

Use @treeloop.zero? instead of @treeloop == 0.
Open

      if @treeloop == 0

This cop checks for usage of comparison operators (==, >, <) to test numbers as zero, positive, or negative. These can be replaced by their respective predicate methods. The cop can also be configured to do the reverse.

The cop disregards #nonzero? as it its value is truthy or falsey, but not true and false, and thus not always interchangeable with != 0.

The cop ignores comparisons to global variables, since they are often populated with objects which can be compared with integers, but are not themselves Interger polymorphic.

Example: EnforcedStyle: predicate (default)

# bad

foo == 0
0 > foo
bar.baz > 0

# good

foo.zero?
foo.negative?
bar.baz.positive?

Example: EnforcedStyle: comparison

# bad

foo.zero?
foo.negative?
bar.baz.positive?

# good

foo == 0
0 > foo
bar.baz > 0

Line is too long. [145/80]
Open

  opt.on('-o <outfile>', '--output <outfile>', 'save the assembly listing in the specified file (defaults to stdout)') { |h| opts[:outfile] = h }

Line is too long. [266/80]
Open

        elsif (dasm.normalize(tempdi.instruction.args.last).is_a? Integer) && !dasm.decode_wstrz(tempdi.instruction.args.last).nil? && (dasm.decode_wstrz(tempdi.instruction.args.last).length > 4) && (dasm.decode_wstrz(tempdi.instruction.args.last) !~ /[\x80-\xff]/n)

Line is too long. [254/80]
Open

    if (dasm.normalize(di.instruction.args.last.symbolic.target).is_a? Integer) && dasm.get_section_at(dasm.normalize(di.instruction.args.last.symbolic.target)) && dasm.decode_dword(dasm.normalize(di.instruction.args.last.symbolic.target)).is_a?(Integer)

Move cblock += parseInstr(di) out of the conditional.
Open

        cblock += parseInstr(di)

This cop checks for identical lines at the beginning or end of each branch of a conditional statement.

Example:

# bad
if condition
  do_x
  do_z
else
  do_y
  do_z
end

# good
if condition
  do_x
else
  do_y
end
do_z

# bad
if condition
  do_z
  do_x
else
  do_z
  do_y
end

# good
do_z
if condition
  do_x
else
  do_y
end

# bad
case foo
when 1
  do_x
when 2
  do_x
else
  do_x
end

# good
case foo
when 1
  do_x
  do_y
when 2
  # nothing
else
  do_x
  do_z
end

Avoid more than 3 levels of block nesting.
Open

        comment += ' -> ' + dasm.get_label_at(tramp.instruction.args.last.symbolic.target.bind.reduce).to_s if dasm.get_label_at(tramp.instruction.args.last.symbolic.target.bind.reduce)

This cop checks for excessive nesting of conditional and looping constructs.

You can configure if blocks are considered using the CountBlocks option. When set to false (the default) blocks are not counted towards the nesting level. Set to true to count blocks as well.

The maximum level of nesting allowed is configurable.

Line is too long. [160/80]
Open

    elsif defined?(di.instruction.args.last.symbolic) && (dasm.backtrace(di.instruction.args.last.symbolic(di), di.address, origin: di.address, type: :x) != [])

Line is too long. [376/80]
Open

    if (dasm.normalize(di.instruction.args.last) != 0) && /^[\x00\x09\x0a\x0d\x20-\x7d]{4}$/n =~ ((dasm.normalize(di.instruction.args.last) & 0xff).chr + ((dasm.normalize(di.instruction.args.last) & 0xff00) >> 8).chr + ((dasm.normalize(di.instruction.args.last) & 0xff0000) >> 16).chr + ((dasm.normalize(di.instruction.args.last) & 0xff000000) >> 24).chr).gsub(/[\x00]/n, ' ')

Line is too long. [101/80]
Open

    fd.puts '        node [color=lightgray, style=filled shape=box fontname="Courier" fontsize="8"];'

Use snake_case for variable names.
Open

  codePatterns = ["\x8b\xff", "\x55\x8b\xec", "\x55\x89\xe5", "\xff\x25", "\xff\x15", "\x48\x83\xec", "\x48\x89\x5c\x24"]

This cop makes sure that all variables use the configured style, snake_case or camelCase, for their names.

Example: EnforcedStyle: snake_case (default)

# bad
fooBar = 1

# good
foo_bar = 1

Example: EnforcedStyle: camelCase

# bad
foo_bar = 1

# good
fooBar = 1

Hard tabs
Open

    ```shell
Severity: Info
Found in CONTRIBUTING.md by markdownlint

MD010 - Hard tabs

Tags: whitespace, hard_tab

Aliases: no-hard-tabs

This rule is triggered by any lines that contain hard tab characters instead of using spaces for indentation. To fix this, replace any hard tab characters with spaces instead.

Example:

Some text

    * hard tab character used to indent the list item

Corrected example:

Some text

    * Spaces used to indent the list item instead

Line length
Open

bugs are presents in the codebase. If you find something that might need a fix or require special attention,
Severity: Info
Found in CONTRIBUTING.md by markdownlint

MD013 - Line length

Tags: line_length

Aliases: line-length Parameters: linelength, codeblocks, tables (number; default 80, boolean; default true)

This rule is triggered when there are lines that are longer than the configured line length (default: 80 characters). To fix this, split the line up into multiple lines.

This rule has an exception where there is no whitespace beyond the configured line length. This allows you to still include items such as long URLs without being forced to break them in the middle.

You also have the option to exclude this rule for code blocks and tables. To do this, set the code_blocks and/or tables parameters to false.

Code blocks are included in this rule by default since it is often a requirement for document readability, and tentatively compatible with code rules. Still, some languages do not lend themselves to short lines.

Consider starting bulleted lists at the beginning of the line
Open

 * AnalyzeIt, a ruby script based on metasm, wich is used to identify interesting points in the binary.
Severity: Info
Found in README.md by markdownlint

MD006 - Consider starting bulleted lists at the beginning of the line

Tags: bullet, ul, indentation

Aliases: ul-start-left

This rule is triggered when top level lists don't start at the beginning of a line:

Some text

  * List item
  * List item

To fix, ensure that top level list items are not indented:

Some test

* List item
* List item

Rationale: Starting lists at the beginning of the line means that nested list items can all be indented by the same amount when an editor's indent function or the tab key is used to indent. Starting a list 1 space in means that the indent of the first nested list is less than the indent of the second level (3 characters if you use 4 space tabs, or 1 character if you use 2 space tabs).

Unordered list indentation
Open

 * AnalyzeIt, a ruby script based on metasm, wich is used to identify interesting points in the binary.
Severity: Info
Found in README.md by markdownlint

MD007 - Unordered list indentation

Tags: bullet, ul, indentation

Aliases: ul-indent

Parameters: indent (number; default 2)

This rule is triggered when list items are not indented by the configured number of spaces (default: 2).

Example:

* List item
   * Nested list item indented by 3 spaces

Corrected Example:

* List item
  * Nested list item indented by 2 spaces

Rationale (2 space indent): indenting by 2 spaces allows the content of a nested list to be in line with the start of the content of the parent list when a single space is used after the list marker.

Rationale (4 space indent): Same indent as code blocks, simpler for editors to implement. See http://www.cirosantilli.com/markdown-styleguide/#indented-lists for more information.

In addition, this is a compatibility issue with multi-markdown parsers, which require a 4 space indents. See http://support.markedapp.com/discussions/problems/21-sub-lists-not-indenting for a description of the problem.

Severity
Category
Status
Source
Language