Showing 8 of 12 total issues
File onkundic.js
has 33373 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// This file is automatically generated by kanjidic.js
module.exports = {
"亜": [
"あ",
Function parseEntry
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
var parseEntry = function parseEntry(fieldDefs, entry) {
fieldDefs = _.clone(fieldDefs);
var fields = entry.match(/(\{[^{}]+\})|([^\s]+)/g);
var args = [];
- 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 parseEntry
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var parseEntry = function parseEntry(fieldDefs, entry) {
fieldDefs = _.clone(fieldDefs);
var fields = entry.match(/(\{[^{}]+\})|([^\s]+)/g);
var args = [];
Function search
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var search = function search(query, bucket, extractor, options) {
if (!query) return [];
options = utils.merge({ threshold: 0 }, options);
Function result
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var result = fields.reduce(function(acc, field, index) {
var defpair = (function() {
// Finds positional field definition
if (fieldDefs[index]) {
return (function(posDef) {
Function fn
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fn: function(args) {
var isOnReading = function isOnReading(field) {
return hirakata.isKata(field.replace(/[\-\.]/g, ''));
};
Function main
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var main = function main(argv) {
fetch(repos.kanjiDic)
.then(function(body) {
return toUtf8(body, 'euc-jp');
})
Function convert
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
var convert = function convert(romajiStr) {
romajiStr = romajiStr.toLowerCase();
var len = romajiStr.length;
var currentIndex = 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"