Showing 130 of 196 total issues
Method concat
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def concat(*matrices)
rank = nil
rank = matrices.pop unless matrices.last.is_a?(NMatrix)
# Find the first matching dimension and concatenate along that (unless rank is specified)
Method repacked_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def repacked_data(to_dtype = nil)
real_mdtype = self.real_part.tag.data_type
# Figure out what dtype to use based on the MATLAB data-types
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method read_entry
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def read_entry f, entry, assign=nil, convert=nil
assign ||= (entry.to_s + "=").to_sym
while line = f.gets
next if line =~ /^\s*#/ # ignore comment lines
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method det
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def det
raise(ShapeError, "determinant can be calculated only for square matrices") unless self.dim == 2 && self.shape[0] == self.shape[1]
# Cast to a dtype for which getrf is implemented
new_dtype = self.integer_dtype? ? :float64 : self.dtype
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method dense_storage_get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def dense_storage_get(slice,stride)
if slice[:single]
return dense_storage_pos(slice[:coords],stride)
else
shape = @shape.dup
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method read_packed
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def read_packed(packedio, options)
raise(ArgumentError, 'Missing mandatory option :endian.') \
unless options.has_key?(:endian)
tag = packedio.read([Tag, {:endian => options[:endian]}])
Method header
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def header
return @header if !@header.empty?
@file = File.open @file_name, "r"
line = @file.gets
Method posv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def posv(uplo, a, b)
raise(ShapeError, "a must be square") unless a.dim == 2 \
&& a.shape[0] == a.shape[1]
raise(ShapeError, "number of rows of b must equal number of cols of a") \
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method posv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def posv(uplo, a, b)
raise(ShapeError, "a must be square") unless a.dim == 2 && a.shape[0] == a.shape[1]
raise(ShapeError, "number of rows of b must equal number of cols of a") unless a.shape[1] == b.shape[0]
raise(StorageTypeError, "only works with dense matrices") unless a.stype == :dense && b.stype == :dense
raise(DataTypeError, "only works for non-integer, non-object dtypes") if
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method >=
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def >= (other)
lha = @s.toArray.to_a
rha = other.s.toArray.to_a
resultArray = Array.new(lha.length)
if (other.is_a?(NMatrix))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method =~
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def =~ (other)
lha = @s.toArray.to_a
rha = other.s.toArray.to_a
resultArray = Array.new(lha.length)
if (other.is_a?(NMatrix))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method <
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def < (other)
lha = @s.toArray.to_a
rha = other.s.toArray.to_a
resultArray = Array.new(lha.length)
if (other.is_a?(NMatrix))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method slice_set
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def slice_set(dest, lengths, pdest, rank, v, v_size, v_offset)
if (dim - rank > 1)
(0...lengths[rank]).each do |i|
slice_set(dest, lengths, pdest + dest[:stride][rank] * i, rank + 1, v, v_size, v_offset);
end
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method !~
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def !~ (other)
lha = @s.toArray.to_a
rha = other.s.toArray.to_a
resultArray = Array.new(lha.length)
if (other.is_a?(NMatrix))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method concat
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def concat(*matrices)
rank = nil
rank = matrices.pop unless matrices.last.is_a?(NMatrix)
# Find the first matching dimension and concatenate along that (unless rank is specified)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method <=
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def <= (other)
lha = @s.toArray.to_a
rha = other.s.toArray.to_a
resultArray = Array.new(lha.length)
if (other.is_a?(NMatrix))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method >
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def > (other)
lha = @s.toArray.to_a
rha = other.s.toArray.to_a
resultArray = Array.new(lha.length)
if (other.is_a?(NMatrix))
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method is_symmetric
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def is_symmetric(hermitian)
is_symmetric = true
if (@shape[0] == @shape[1] and @dim == 2)
if @stype == :dense
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method pinv
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def pinv(tolerance = 1e-15)
raise DataTypeError, "pinv works only with matrices of float or complex data type" unless
[:float32, :float64, :complex64, :complex128].include?(dtype)
if self.complex_dtype?
u, s, vt = self.complex_conjugate.gesvd # singular value decomposition
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method rot
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def rot(x, y, c, s, incx = 1, incy = 1, n = nil, in_place=false)