Showing 10 of 10 total issues
Function getData
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getData(path) {
var obj = {};
var data = fs.readFileSync(path, "UTF-8");
init();
Function getText
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function getText(name) {
var text = fs.readFileSync(name, "UTF-8");
var data = JSON.parse(text);
function iterateData(data, result, prefix) {
- 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 setData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setData(newdata, dir, fromLang, toLang) {
var files = getFiles(dir, fromLang);
files.map(function(name) {
var olddata = getText(name);
Function load
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function load(opts) {
var data = {};
function getData(os, dir, from, to) {
if (!dir) {
- 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 checkQuote
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function checkQuote() {
if (commentLine || commentBlock) {
return;
} else if (escape) {
add("\"");
- 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 getData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function getData(path) {
var obj = {};
var data = fs.readFileSync(path, "UTF-8");
init();
- 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 checkComma
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function checkComma(array) {
if (escape) {
if (lastChar === "\"" && !singlequote) {
comma++;
escape = false;
- 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 checkSlash
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function checkSlash() {
if (word) {
add("/");
} else {
if (lastChar === "/" && !commentBlock) {
- 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 setData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function setData(path, data, olddata) {
var string = "";
for (var key in data) {
if (data.hasOwnProperty(key)) {
var value = data[key];
- 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 checkNewline
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function checkNewline(array) {
if (escape) {
if (lastChar === "\"" && !singlequote) {
array.push(line);
init();
- 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"