Showing 14 of 52 total issues
Function alterTable
has 157 lines of code (exceeds 25 allowed). Consider refactoring. Open
alterTable: function(data) {
/* jscs:disable jsDoc */
// we know the phrasing is capable of handling one index creation or index
// drop. we need to create a procedure if there are more operations
`` has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Translator.reopen(/** @lends Translator# */ {
/**
* Translate a predicate and the corresponding args into a format string and
* arguments that can be used while creating expressions.
File condition.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
var _ = require('lodash');
var Class = require('corazon/class');
var FieldString = require('../types/field');
Function alterTable
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
alterTable: function(data) {
/* jscs:disable jsDoc */
// we know the phrasing is capable of handling everything other than index
// renaming. we need to create a procedure if any index renames occur.
Function alterTable
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
alterTable: function(data) {
// create a base statement that does not include renames, addition of
// indexes, dropped indexes, or renamed indexes.
var statement = this._phrasing.alterTable(_.extend({}, data, {
renamed: [],
Function alterTable
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
alterTable: function(data) {
var statement;
var alterations =
data.added.length +
data.addedIndexes.length +
Function insert
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
insert: function(data) {
var table = data.table;
var returning = data.returning;
var quoteField = this._grammar.field.bind(this._grammar);
var quoteValue = this._grammar.value.bind(this._grammar);
Function createTable
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var createTable = function() {
var dbcols = this.dbcols.filter(notDroppedColumn);
var dbfks = this.dbfks.filter(notDroppedForeignKey);
var phrasing = self._phrasing;
var columnFragment = phrasing.columnFragment.bind(phrasing);
Function parseWeekdayToInt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports.parseWeekdayToInt = function(weekday) {
var result;
if (weekday.match(/^sun(?:day)?$/i)) { result = 0; }
else if (weekday.match(/^mon(?:day)?$/i)) { result = 1; }
else if (weekday.match(/^tues(?:day)?$/i)) { result = 2; }
- 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 _validateBinaryOperations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_validateBinaryOperations: function() {
this._parts.forEach(function(part, index) {
if (!(part instanceof Operation.Binary.__class__)) { return; }
var previous = this._parts[index - 1];
- 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 foreignKeyFragment
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
foreignKeyFragment: function(column) {
var quoteField = this._grammar.field.bind(this._grammar);
var action = this.foreignKeyActionFragment.bind(this);
var reference = column.options.references;
var parts = reference.split('.');
- 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 fetchOne
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
fetchOne: function() {
return this.fetch().then(function(results) {
var error;
if (results.length === 0) {
error = _.extend(new Error('No results found.'), {
- 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 _initialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
_initialize: function(parts) {
parts.forEach(function(part) {
if (Array.isArray(part)) {
this._parts.push(Condition.create.apply(Condition, part));
}
- 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 alterTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
alterTable: function(data) {
var statement;
var alterations =
data.added.length +
data.addedIndexes.length +
- 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"