builtinnya/fuzzlogia

View on GitHub

Showing 8 of 12 total issues

File onkundic.js has 33373 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// This file is automatically generated by kanjidic.js

module.exports = {
  "亜": [
    "あ",
Severity: Major
Found in src/onkundic.js - About 3 mos to fix

    Function parseEntry has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
    Open

    var parseEntry = function parseEntry(fieldDefs, entry) {
      fieldDefs = _.clone(fieldDefs);
    
      var fields = entry.match(/(\{[^{}]+\})|([^\s]+)/g);
      var args = [];
    Severity: Minor
    Found in tools/kanjidic.js - About 3 hrs 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 parseEntry has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var parseEntry = function parseEntry(fieldDefs, entry) {
      fieldDefs = _.clone(fieldDefs);
    
      var fields = entry.match(/(\{[^{}]+\})|([^\s]+)/g);
      var args = [];
    Severity: Major
    Found in tools/kanjidic.js - About 2 hrs to fix

      Function search has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var search = function search(query, bucket, extractor, options) {
        if (!query) return [];
      
        options = utils.merge({ threshold: 0 }, options);
      
      
      Severity: Minor
      Found in src/fuzzlogia.js - About 1 hr to fix

        Function result has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var result = fields.reduce(function(acc, field, index) {
            var defpair = (function() {
              // Finds positional field definition
              if (fieldDefs[index]) {
                return (function(posDef) {
        Severity: Minor
        Found in tools/kanjidic.js - About 1 hr to fix

          Function fn has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              fn: function(args) {
          
                var isOnReading = function isOnReading(field) {
                  return hirakata.isKata(field.replace(/[\-\.]/g, ''));
                };
          Severity: Minor
          Found in tools/kanjidic.js - About 1 hr to fix

            Function main has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var main = function main(argv) {
              fetch(repos.kanjiDic)
                .then(function(body) {
                  return toUtf8(body, 'euc-jp');
                })
            Severity: Minor
            Found in tools/kanjidic.js - About 1 hr to fix

              Function convert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
              Open

              var convert = function convert(romajiStr) {
                romajiStr = romajiStr.toLowerCase();
              
                var len = romajiStr.length;
                var currentIndex = 0;
              Severity: Minor
              Found in src/romaji2hira.js - About 45 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