Method get_slice
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def get_slice(dim, args, shape_array)
slice = {}
slice[:coords]=[]
slice[:lengths]=[]
slice[:single] = true
- 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 get_slice
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_slice(dim, args, shape_array)
slice = {}
slice[:coords]=[]
slice[:lengths]=[]
slice[:single] = true
Method dense_storage_get
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dense_storage_get(slice,stride)
if slice[:single]
return dense_storage_pos(slice[:coords],stride)
else
shape = @shape.dup
Method dense_storage_set
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def dense_storage_set(slice, right)
stride = get_stride(self)
v_size = 1
if right.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 dense_storage_set
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dense_storage_set(slice, right)
stride = get_stride(self)
v_size = 1
if right.is_a?(NMatrix)
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 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 xslice
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def xslice(args)
result = nil
if self.dim < args.length
raise(ArgumentError,"wrong number of arguments (#{args} for #{effective_dim(self)})")
- 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 xslice_ref
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def xslice_ref(args)
result = nil
if self.dim < args.length
raise(ArgumentError,"wrong number of arguments (#{args} for #{effective_dim(self)})")
- 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 7 arguments (exceeds 4 allowed). Consider refactoring. Open
def slice_set(dest, lengths, pdest, rank, v, v_size, v_offset)
Method slice_copy
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def slice_copy(src, dest,lengths, pdest, psrc,n)
Method dense_storage_coords
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def dense_storage_coords(s, slice_pos, coords_out, stride, offset) #array, int, array