Jintin/transai

View on GitHub

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();

Severity: Minor
Found in lib/iosParser.js - About 1 hr to fix

    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) {
    Severity: Minor
    Found in lib/web.js - About 1 hr to fix

    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);
    Severity: Minor
    Found in lib/web.js - About 1 hr to fix

      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) {
      Severity: Minor
      Found in index.js - About 55 mins to fix

      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("\"");
      Severity: Minor
      Found in lib/iosParser.js - About 35 mins to fix

      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();
      
      
      Severity: Minor
      Found in lib/iosParser.js - About 35 mins to fix

      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;
      Severity: Minor
      Found in lib/csv.js - About 25 mins to fix

      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) {
      Severity: Minor
      Found in lib/iosParser.js - About 25 mins to fix

      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];
      Severity: Minor
      Found in lib/iosParser.js - About 25 mins to fix

      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();
      Severity: Minor
      Found in lib/csv.js - About 25 mins to fix

      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

      Severity
      Category
      Status
      Source
      Language