ANSSI-FR/polichombr

View on GitHub

Showing 1,243 of 1,244 total issues

Use snake_case for variable names.
Open

      strArg = '' if strArg.nil?

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 snake_case for variable names.
Open

        strArg = [nil, 'TokenUser', 'TokenGroups', 'TokenPrivileges', 'TokenOwner', 'TokenPrimaryGroup', 'TokenDefaultDacl', 'TokenSource', 'TokenType', 'TokenImpersonationLevel', 'TokenStatistics', 'TokenRestrictedSids', 'TokenSessionId', 'TokenGroupsAndPrivileges', 'TokenSessionReference', 'TokenSandBoxInert', 'TokenAuditPolicy', 'TokenOrigin', 'TokenElevationType', 'TokenLinkedToken', 'TokenElevation', 'TokenHasRestrictions', 'TokenAccessInformation', 'TokenVirtualizationAllowed', 'TokenVirtualizationEnabled', 'TokenIntegrityLevel', 'TokenUIAccess', 'TokenMandatoryPolicy', 'TokenLogonSid', 'TokenIsAppContainer', 'TokenCapabilities', 'TokenAppContainerSid', 'TokenAppContainerNumber', 'TokenUserClaimAttributes', 'TokenDeviceClaimAttributes', 'TokenRestrictedUserClaimAttributes', 'TokenRestrictedDeviceClaimAttributes', 'TokenDeviceGroups', 'TokenRestrictedDeviceGroups', 'TokenSecurityAttributes', 'TokenIsRestricted', 'MaxTokenInfoClass'][carg]

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 snake_case for variable names.
Open

    argStr = dasm.decode_strz(di.instruction.args.first)

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 snake_case for variable names.
Open

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

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 snake_case for variable names.
Open

      strToInj = ''

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 snake_case for variable names.
Open

dasm.sections.each do |secAddr, secDatas|

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 each_value instead of each.
Open

      indent.each do |_id, _iscontinue|

This cop checks for uses of each_key and each_value Hash methods.

Note: If you have an array of two-element arrays, you can put parentheses around the block arguments to indicate that you're not working with a hash, and suppress RuboCop offenses.

Example:

# bad
hash.keys.each { |k| p k }
hash.values.each { |v| p v }
hash.each { |k, _v| p k }
hash.each { |_k, v| p v }

# good
hash.each_key { |k| p k }
hash.each_value { |v| p v }

Prefer Date or Time over DateTime.
Open

  @compiled_date = DateTime.strptime(date_str, '%s')

This cop checks for uses of DateTime that should be replaced by Date or Time.

Example:

# bad - uses `DateTime` for current time
DateTime.now

# good - uses `Time` for current time
Time.now

# bad - uses `DateTime` for modern date
DateTime.iso8601('2016-06-29')

# good - uses `Date` for modern date
Date.iso8601('2016-06-29')

# good - uses `DateTime` with start argument for historical date
DateTime.iso8601('1751-04-23', Date::ENGLAND)

Prefer annotated tokens (like %<foo>s</foo>) over unannotated tokens (like %s).
Open

  @compiled_date = DateTime.strptime(date_str, '%s')

Use a consistent style for named format string tokens.

Note: unannotated style cop only works for strings which are passed as arguments to those methods: sprintf, format, %. The reason is that unannotated format is very similar to encoded URLs or Date/Time formatting strings.

Example: EnforcedStyle: annotated (default)

# bad
format('%{greeting}', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%<greeting>s', greeting: 'Hello')</greeting>

Example: EnforcedStyle: template

# bad
format('%<greeting>s', greeting: 'Hello')
format('%s', 'Hello')

# good
format('%{greeting}', greeting: 'Hello')</greeting>

Example: EnforcedStyle: unannotated

# bad
format('%<greeting>s', greeting: 'Hello')
format('%{greeting}', 'Hello')

# good
format('%s', 'Hello')</greeting>

Do not introduce global variables.
Open

    log("Top of function : #{PoliUtils.poliLinkAddr(basefunc)} ; Top of block : #{PoliUtils.poliLinkAddr($gdasm.di_at(xrefCall).block.list[0].address)}")

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

                 "'#{$gdasm.decode_strz(carg)}'"

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

                 "0x#{$gdasm.decode_dword(carg).to_s(16)}"

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

        strArg = format('{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}', $gdasm.decode_dword(carg), ($gdasm.decode_dword(carg + 4) & 0xffff), ($gdasm.decode_dword(carg + 6) & 0xffff), $gdasm.decode_byte(carg + 8), $gdasm.decode_byte(carg + 9), $gdasm.decode_byte(carg + 10), $gdasm.decode_byte(carg + 11), $gdasm.decode_byte(carg + 12), $gdasm.decode_byte(carg + 13), $gdasm.decode_byte(carg + 14), $gdasm.decode_byte(carg + 15), $gdasm.decode_byte(carg + 16))

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Use snake_case for variable names.
Open

      strArg = { 0x80000000 => 'HKEY_CLASSES_ROOT ', 0x80000001 => 'HKEY_CURRENT_USER', 0x80000002 => 'HKEY_LOCAL_MACHINE', 0x80000003 => 'HKEY_USERS', 0x80000004 => 'HKEY_PERFORMANCE_DATA', 0x80000005 => 'HKEY_CURRENT_CONFIG', 0x80000006 => 'HKEY_DYN_DATA' }[carg]

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 snake_case for variable names.
Open

def is_linked_func(currFunc, start_address, stop_address)

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 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 snake_case for variable names.
Open

@strDNS = []

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 snake_case for variable names.
Open

      sizeMin = cptr if sizeMin > cptr

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

Do not introduce global variables.
Open

        di = $gdasm.di_at(di.block.list[0].block.from_subfuncret[0])

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read

Do not introduce global variables.
Open

      strArg = if $gdasm.decode_dword(carg)

This cops looks for uses of global variables. It does not report offenses for built-in global variables. Built-in global variables are allowed by default. Additionally users can allow additional variables via the AllowedVariables option.

Note that backreferences like $1, $2, etc are not global variables.

Example:

# bad
$foo = 2
bar = $foo + 5

# good
FOO = 2
foo = 2
$stdin.read
Severity
Category
Status
Source
Language