MatteoRagni/cas-rb

View on GitHub
lib/Mr.CAS/latex.rb

Summary

Maintainability
A
0 mins
Test Coverage

Use 2 (not 0) spaces for indenting an expression spanning multiple lines.
Open

      "    #{x.latex} & #{condition.latex} \\\\" +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Use 2 (not 0) spaces for indenting an expression spanning multiple lines.
Open

      "\\right."
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Empty interpolation detected.
Open

    CAS::Abs    => Proc.new { "\\left| #{}{x.latex} \\right|" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for empty interpolation.

Example:

# bad

"result is #{}"

Example:

# good

"result is #{some_result}"

Use proc instead of Proc.new.
Open

    CAS::Variable              => Proc.new { "#{name}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Smaller      => Proc.new { "#{x.latex} < #{y.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use \ instead of + or << to concatenate those strings.
Open

      "    #{y.latex}" +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Prefer to_s over string interpolation.
Open

    CAS::Variable              => Proc.new { "#{name}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Use \ instead of + or << to concatenate those strings.
Open

      "  \\end{array}" +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Use proc instead of Proc.new.
Open

    CAS::Prod   => Proc.new { "\\left( #{x.latex} \\, #{y.latex} \\right)"},
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Ln     => Proc.new { "\\log \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

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

      "\\left\\{ " +
Severity: Minor
Found in lib/Mr.CAS/latex.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"

Extra blank line detected.
Open


  }.each do |cls, blk|
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for two or more consecutive blank lines.

Example:

# bad - It has two empty lines.
some_method
# one empty line
# two empty lines
some_method

# good
some_method
# one empty line
some_method

Missing top-level module documentation comment.
Open

module CAS
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

Example:

# bad
class Person
  # ...
end

# good
# Description/Explanation of Person class
class Person
  # ...
end

Use 2 (not 0) spaces for indenting an expression spanning multiple lines.
Open

      "    #{y.latex}" +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Use \ instead of + or << to concatenate those strings.
Open

      "\\left\\{ " +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Use \ instead of + or << to concatenate those strings.
Open

      "  \\begin{array}{lr} " +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

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

      "  \\end{array}" +
Severity: Minor
Found in lib/Mr.CAS/latex.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"

Use proc instead of Proc.new.
Open

    CAS::BoxConditionClosed      => Proc.new { "#{lower.latex} \\leq #{x.latex} \\leq #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Prefer to_s over string interpolation.
Open

    CAS::Constant              => Proc.new { "#{x}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for strings that are just an interpolated expression.

Example:

# bad
"#{@var}"

# good
@var.to_s

# good if @var is already a String
@var

Use proc instead of Proc.new.
Open

    CAS::Max => Proc.new { "\\max \\left( #{x.latex}, \\, #{y.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Equal        => Proc.new { "#{x.latex} = #{y.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::BoxConditionUpperClosed => Proc.new { "#{lower.latex} < #{x.latex} \\leq #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Greater      => Proc.new { "#{x.latex} > #{y.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::SmallerEqual => Proc.new { "#{x.latex} \\leq #{y.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

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

    CAS::PI_CONSTANT           => Proc.new { "\\pi" },
Severity: Minor
Found in lib/Mr.CAS/latex.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"

Use \ instead of + or << to concatenate those strings.
Open

      "    #{x.latex} & #{condition.latex} \\\\" +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for string literal concatenation at the end of a line.

Example:

# bad
some_str = 'ala' +
           'bala'

some_str = 'ala' <<
           'bala'

# good
some_str = 'ala' \
           'bala'

Use proc instead of Proc.new.
Open

    CAS::Tan    => Proc.new { "\\tan \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

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

    CAS::INFINITY_CONSTANT     => Proc.new { "\\infty" },
Severity: Minor
Found in lib/Mr.CAS/latex.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

    cls.send(:define_method, "to_latex", &blk)
Severity: Minor
Found in lib/Mr.CAS/latex.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"

Script file latex.rb doesn't have execute permission.
Open

#!/usr/bin/env ruby
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Avoid using {...} for multi-line blocks.
Open

    CAS::Piecewise => Proc.new {
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Check for uses of braces or do/end around single line or multi-line blocks.

Example: EnforcedStyle: linecountbased (default)

# bad - single line block
items.each do |item| item / 5 end

# good - single line block
items.each { |item| item / 5 }

# bad - multi-line block
things.map { |thing|
  something = thing.some_method
  process(something)
}

# good - multi-line block
things.map do |thing|
  something = thing.some_method
  process(something)
end

Example: EnforcedStyle: semantic

# Prefer `do...end` over `{...}` for procedural blocks.

# return value is used/assigned
# bad
foo = map do |x|
  x
end
puts (map do |x|
  x
end)

# return value is not used out of scope
# good
map do |x|
  x
end

# Prefer `{...}` over `do...end` for functional blocks.

# return value is not used out of scope
# bad
each { |x|
  x
}

# return value is used/assigned
# good
foo = map { |x|
  x
}
map { |x|
  x
}.inspect

Example: EnforcedStyle: bracesforchaining

# bad
words.each do |word|
  word.flip.flop
end.join("-")

# good
words.each { |word|
  word.flip.flop
}.join("-")

Use proc instead of Proc.new.
Open

    CAS::Cos    => Proc.new { "\\cos \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Exp    => Proc.new { "e^#{x.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::BoxConditionOpen        => Proc.new { "#{lower.latex} < #{x.latex} < #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use 2 (not 0) spaces for indenting an expression spanning multiple lines.
Open

      "  \\end{array}" +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Use proc instead of Proc.new.
Open

    CAS::Constant              => Proc.new { "#{x}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::NEG_INFINITY_CONSTANT => Proc.new { "-\\infty" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Piecewise => Proc.new {
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Line is too long. [81/80]
Open

    CAS::Max => Proc.new { "\\max \\left( #{x.latex}, \\, #{y.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Use proc instead of Proc.new.
Open

    CAS::Pow    => Proc.new { "{#{x.latex}}^{#{y.latex}}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Sqrt   => Proc.new { "\\sqrt{#{x.latex}}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::GreaterEqual => Proc.new { "#{x.latex} \\geq #{y.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Space missing inside }.
Open

    CAS::Prod   => Proc.new { "\\left( #{x.latex} \\, #{y.latex} \\right)"},
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Checks that block braces have or don't have surrounding space inside them on configuration. For blocks taking parameters, it checks that the left brace has or doesn't have trailing space depending on configuration.

Example: EnforcedStyle: space (default)

# The `space` style enforces that block braces have
# surrounding space.

# bad
some_array.each {puts e}

# good
some_array.each { puts e }

Example: EnforcedStyle: no_space

# The `no_space` style enforces that block braces don't
# have surrounding space.

# bad
some_array.each { puts e }

# good
some_array.each {puts e}

Example: EnforcedStyleForEmptyBraces: no_space (default)

# The `no_space` EnforcedStyleForEmptyBraces style enforces that
# block braces don't have a space in between when empty.

# bad
some_array.each {   }
some_array.each {  }
some_array.each { }

# good
some_array.each {}

Example: EnforcedStyleForEmptyBraces: space

# The `space` EnforcedStyleForEmptyBraces style enforces that
# block braces have at least a spece in between when empty.

# bad
some_array.each {}

# good
some_array.each { }
some_array.each {  }
some_array.each {   }

Example: SpaceBeforeBlockParameters: true (default)

# The SpaceBeforeBlockParameters style set to `true` enforces that
# there is a space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each {|n| n * 2 }

# good
[1, 2, 3].each { |n| n * 2 }

Example: SpaceBeforeBlockParameters: true

# The SpaceBeforeBlockParameters style set to `false` enforces that
# there is no space between `{` and `|`. Overrides `EnforcedStyle`
# if there is a conflict.

# bad
[1, 2, 3].each { |n| n * 2 }

# good
[1, 2, 3].each {|n| n * 2 }

Use proc instead of Proc.new.
Open

    CAS::Sum    => Proc.new { "\\left( #{x.latex} + #{y.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Abs    => Proc.new { "\\left| #{}{x.latex} \\right|" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Acos   => Proc.new { "\\arccos \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::BoxConditionLowerClosed => Proc.new { "#{lower.latex} \\leq #{x.latex} < #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Min => Proc.new { "\\min \\left( #{x.latex}, \\, #{y.latex} \\right)" }
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Line is too long. [96/80]
Open

    CAS::BoxConditionOpen        => Proc.new { "#{lower.latex} < #{x.latex} < #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Use proc instead of Proc.new.
Open

    CAS::PI_CONSTANT           => Proc.new { "\\pi" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::INFINITY_CONSTANT     => Proc.new { "\\infty" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Sin    => Proc.new { "\\sin \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Invert => Proc.new { "-#{x.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

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

      "  \\begin{array}{lr} " +
Severity: Minor
Found in lib/Mr.CAS/latex.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"

Use proc instead of Proc.new.
Open

    CAS::Atan   => Proc.new { "\\arctan \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

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

      "\\right."
Severity: Minor
Found in lib/Mr.CAS/latex.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"

Use 2 (not 0) spaces for indenting an expression spanning multiple lines.
Open

      "  \\begin{array}{lr} " +
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks the indentation of the right hand side operand in binary operations that span more than one line.

Example:

# bad
if a +
b
  something
end

# good
if a +
   b
  something
end

Avoid empty expressions.
Open

    CAS::Abs    => Proc.new { "\\left| #{}{x.latex} \\right|" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cop checks for the presence of empty expressions.

Example:

# bad

foo = ()
if ()
  bar
end

Example:

# good

foo = (some_expression)
if (some_expression)
  bar
end

Line is too long. [104/80]
Open

    CAS::BoxConditionClosed      => Proc.new { "#{lower.latex} \\leq #{x.latex} \\leq #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Line is too long. [100/80]
Open

    CAS::BoxConditionUpperClosed => Proc.new { "#{lower.latex} < #{x.latex} \\leq #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Line is too long. [100/80]
Open

    CAS::BoxConditionLowerClosed => Proc.new { "#{lower.latex} \\leq #{x.latex} < #{upper.latex}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

Use proc instead of Proc.new.
Open

    CAS::Diff   => Proc.new { "\\left( #{x.latex} - #{y.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Div    => Proc.new { "\\dfrac{#{x.latex}}{#{y.latex}}" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

Use proc instead of Proc.new.
Open

    CAS::Asin   => Proc.new { "\\arcsin \\left( #{x.latex} \\right)" },
Severity: Minor
Found in lib/Mr.CAS/latex.rb by rubocop

This cops checks for uses of Proc.new where Kernel#proc would be more appropriate.

Example:

# bad
p = Proc.new { |n| puts n }

# good
p = proc { |n| puts n }

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

    CAS::NEG_INFINITY_CONSTANT => Proc.new { "-\\infty" },
Severity: Minor
Found in lib/Mr.CAS/latex.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"

There are no issues that match your filters.

Category
Status