Showing 33 of 113 total issues
Function exports
has 246 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
// http://stackoverflow.com/questions/90002/
// "What is a reasonable code coverage for unit tests (and why)?"
Function indexOf
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
if (this === null) {
throw new TypeError();
}
- 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 Ships
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Game.Ships = ( function() {
return {
/**
* Array of abbreviations for ship classification.
* Caveat: WSH's Active Script engine requires us to append
File tokenizer.js
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* @fileOverview A partical object for tokenizers.
* @author kclv@ermitejo.com (MORIYA Masaki, alias Gardejo)
* @license The MIT license (See LICENSE file)
*/
Function reduce
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.reduce = function reduce(accumulator){
if (this===null || this===undefined) {
throw new TypeError("Object is null or undefined");
}
- 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 Array
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
kclv.Array = ( function() {
return {
/**
* Get a subset of specified array by specified indices.
* It is similar to a slice access to array in Perl
- 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 filter
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.filter = function(fun /*, thisArg */)
{
if (this === void 0 || this === null) {
throw new TypeError();
- 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 Array
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Array = ( function() {
return {
/**
* Get a subset of specified array by specified indices.
* It is similar to a slice access to array in Perl
Function map
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.map = function(fun /*, thisArg */)
{
if (this === void 0 || this === null) {
throw new TypeError();
- 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 buildOption
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Chart.Line.prototype.buildOption = function() {
var material = this.table.kind,
kind = kclv.Game.Materials.getKindOf(material),
configuration = this.cascadeHorizontalConfiguration(kind, 'Materials'),
option =
Function Configuration
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Configuration = ( function() {
/**
* The configuration structure as a Flyweight object.
* @private {Object.<string, *>}
*/
Function visualize
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Visualizer.prototype.visualize = function(directive) {
if (! directive) {
throw new Error('Visualizer requires some directive.');
}
Function buildRows
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Table.Ships.Base.prototype.buildRows = function() {
var indexOf = this.getClassificationDictionary_(),
attributeOf = this.relation.getAttributes(),
relation = this.canonizeRelation_(attributeOf),
mothballLevel =
Function keys
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Object.keys = (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'),
dontEnums = [
'toString',
Function Materials
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Game.Materials = ( function() {
/**
* (Reserved) The maximum value of supplies of materials.
* @private {Object.<string, number>}
* @const
Function forEach
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.forEach = function( callback, thisArg ) {
var T, k;
if ( this === null ) {
- 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 buildRows
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Table.Ships.Bubble.prototype.buildRows = function() {
var roster = this.buildRoster_(),
threshold =
kclv.Configuration.get('chart.Ships.vertical.level', true) || 0,
label = kclv.Configuration.get([
Function Materials
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
kclv.Game.Materials = ( function() {
/**
* (Reserved) The maximum value of supplies of materials.
* @private {Object.<string, number>}
* @const
- 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 indexOf
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) {
if (this === null) {
throw new TypeError();
}
Function toPeriod
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
kclv.Date.prototype.toPeriod = function(frequency) {
switch (frequency) {
case 'Yearly':
return {
v : this.toNewYearsDay(),