Showing 31 of 61 total issues
Method _compress
has a Cognitive Complexity of 105 (exceeds 5 allowed). Consider refactoring. Open
def _compress(uncompressed, bits_per_char)
return "" if uncompressed.nil?
context_dictionary = {}
context_dictionary_to_create = {}
- 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 _decompress
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
def _decompress(length, reset_value)
dictionary = []
enlarge_in = 4
dict_size = 4
num_bits = 3
- 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 _compress
has 202 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _compress(uncompressed, bits_per_char)
return "" if uncompressed.nil?
context_dictionary = {}
context_dictionary_to_create = {}
File lz_string.rb
has 452 lines of code (exceeds 250 allowed). Consider refactoring. Open
module IdPack
module LZString
KEY_STR_BASE64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".freeze
KEY_STR_URI_SAFE = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$".freeze
Function range
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
range: function(start, length) {
/** convert arguments to numbers */
if (typeof start != 'number') {
start = parseInt(start, 10);
Method _decompress
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
def _decompress(length, reset_value)
dictionary = []
enlarge_in = 4
dict_size = 4
num_bits = 3
Method alphanum_compress
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
def alphanum_compress(arr, alphanum_string, order)
# length of UUID in bits
uuid_bit_length = 128
# compress without delta
- 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 alphanum_decompress
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def alphanum_decompress(str, alphanum_string)
# length of UUID in bits
uuid_bit_length = 128
result = []
- 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 encode
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def encode(array, window_size = WINDOW_SIZE, _exclude_nil = EXCLUDE_NIL, output_charset = ENCODED_NUMBER_CHARS)
encoded_array = ''
ranges = convert_numbers_to_ranges array.uniq.sort
prev_end = 0
- 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
File id-packer.js
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** vim: et:ts=2:sw=2:sts=2
* @license (c) 2017 Ribose Inc.
*
* IdPacker is a library provides encoding support for Number collections (Arrays or Objects).
*
Function encodeHashKeys
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
encodeHashKeys: function(hash, windowSize, isExcludeNull, outputCharset) {
// set default values
windowSize = typeof windowSize === "number" ? windowSize : this.windowSize;
isExcludeNull = typeof isExcludeNull === "boolean" ? isExcludeNull : this.isExcludeNull;
outputCharset = typeof outputCharset === "string" ? outputCharset : this.outputCharset;
Method encode
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
def encode(array, window_size = WINDOW_SIZE, _exclude_nil = EXCLUDE_NIL, output_charset = ENCODED_NUMBER_CHARS)
encoded_array = ''
ranges = convert_numbers_to_ranges array.uniq.sort
prev_end = 0
Function alpCompress
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
alpCompress: function(arr, alpStr, order) {
// declare starting values
var
alpArr = alptoArr(alpStr, false), // get alphabet array without delimiter
nresult = '', // without delta we starting with only one bit
Method alphanum_decompress
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
def alphanum_decompress(str, alphanum_string)
# length of UUID in bits
uuid_bit_length = 128
result = []
Method alphanum_compress
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
def alphanum_compress(arr, alphanum_string, order)
# length of UUID in bits
uuid_bit_length = 128
# compress without delta
Function alpDecompress
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
alpDecompress: function (str, alpStr) {
// declare starting values
var
result = [],
alpArr = alptoArr(alpStr, false), // get alphabet array without delimiter
File id_packer.rb
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
module IdPack
# This is a module to encode an integer array into our compressed format.
# Basically there are only 2 methods in this module, encode and decode.
#
File uuid-packer.js
has 279 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** vim: et:ts=2:sw=2:sts=2
* @license (c) 2017 Ribose Inc.
*/
(function (factory) {
'use strict';
Method decode
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def decode(encoded_caches)
curr_encoded_string_prefix = nil
ids = []
start_id = 0
- 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 alphanum_to_array
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def alphanum_to_array(alphanum_string, del)
alphanum_array = []
el = alphanum_string.length
- 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"