Showing 30 of 35 total issues
Avoid deeply nested control flow statements. Open
if (head_char_class.class_name !== next_char_class.class_name) {
break;
}
Avoid deeply nested control flow statements. Open
if (compatible_category == null) {
continue;
}
Consider simplifying this complex logical expression. Open
if (forward_id < 0 || backward_id < 0 || !isFinite(forward_id) || !isFinite(backward_id) ||
this.connection_cost.forward_dimension <= forward_id || this.connection_cost.backward_dimension <= backward_id) {
throw "Parse error of matrix.def";
}
Function formatUnknownEntry
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
IpadicFormatter.prototype.formatUnknownEntry = function (word_id, position, type, features, surface_form) {
Function put
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
TokenInfoDictionary.prototype.put = function (left_id, right_id, word_cost, surface_form, feature) {
Function CharacterClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function CharacterClass(class_id, class_name, is_always_invoke, is_grouping, max_length) {
Function getString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ByteBuffer.prototype.getString = function (index) {
var buf = [],
ch;
if (index == null) {
index = this.position;
- 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
Function putLine
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ConnectionCostsBuilder.prototype.putLine = function (line) {
if (this.lines === 0) {
var dimensions = line.split(" ");
var forward_dimension = dimensions[0];
var backward_dimension = dimensions[1];
- 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
Function buildDictionary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
TokenInfoDictionary.prototype.buildDictionary = function (entries) {
var dictionary_entries = {}; // using as hashmap, string -> string (word_id -> surface_form) to build dictionary
for (var i = 0; i < entries.length; i++) {
var entry = entries[i];
- 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
Function charCodeAt
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
SurrogateAwareString.prototype.charCodeAt = function (index) {
if (this.index_mapping.length <= index) {
return NaN;
}
var surrogate_aware_index = this.index_mapping[index];
- 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"