doches/rwordnet

View on GitHub
lib/rwordnet/pointer.rb

Summary

Maintainability
A
0 mins
Test Coverage

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

      source == "00" && target == "00"
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Prefer single-quoted strings when you don't need string interpolation or special symbols.
Open

      source == "00" && target == "00"
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Checks if uses of quotes match the configured preference.

Example: EnforcedStyle: single_quotes (default)

# bad
"No special symbols"
"No string interpolation"
"Just text"

# good
'No special symbols'
'No string interpolation'
'Just text'
"Wait! What's #{this}!"

Example: EnforcedStyle: double_quotes

# bad
'Just some text'
'No special chars or interpolation'

# good
"Just some text"
"No special chars or interpolation"
"Every string in #{project} uses double_quotes"

Line is too long. [81/80]
Open

  # Pointers represent the relations between the words in one synset and another.
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Line is too long. [101/80]
Open

    # Create a pointer. Pointers represent the relations between the words in one synset and another,
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Space missing after comma.
Open

      @target = source.slice!(2,2)
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

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. [84/80]
Open

    # and are referenced by a shorthand symbol (e.g. '!' for verb antonym). The list
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Line is too long. [104/80]
Open

    # The symbol that devices the relationship this pointer represents, e.g. "!" for verb antonym. Valid
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Do not use parallel assignment.
Open

      @symbol, @offset, @pos, @source = symbol, offset, pos, source
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Checks for simple usages of parallel assignment. This will only complain when the number of variables being assigned matched the number of assigning variables.

Example:

# bad
a, b, c = 1, 2, 3
a, b, c = [1, 2, 3]

# good
one, two = *foo
a, b = foo()
a, b = b, a

a = 1
b = 2
c = 3

Line is too long. [100/80]
Open

    # The part of speech this pointer represents. One of 'n', 'v', 'a' (adjective), or 'r' (adverb).
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

Rename is_semantic? to semantic?.
Open

    def is_semantic?
Severity: Minor
Found in lib/rwordnet/pointer.rb by rubocop

This cop makes sure that predicates are named properly.

Example:

# bad
def is_even?(value)
end

# good
def even?(value)
end

# bad
def has_value?
end

# good
def value?
end

There are no issues that match your filters.

Category
Status