Showing 12 of 14 total issues
File module.js
has 560 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* jslint node: true, esnext: true */
'use strict';
const crypto = require('crypto'),
Function exec_ddl
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
exec_ddl(db, createOptions, callback) {
if (!createOptions)
createOptions = {
'load_data': true
Function parse_constraints
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function parse_constraints(ps, cs) {
let gotSomething;
let str = ps.input;
if (str) {
- 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 tables_from_db
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function tables_from_db(db, callback) {
db.all("SELECT name,sql FROM sqlite_master WHERE type='table'", (error, rows) => {
if (error) {
callback(error);
return;
Function migrate_data
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
migrate_data(db, data_sets, callback) {
const update = function (table, sql, values) {
const v = [];
const l = table.pk().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"
Further reading
Function pk
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
pk() {
const pk = [];
for (const i in this.attributes) {
const a = this.attributes[i];
- 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 Constraint
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function Constraint(type, properties) {
if (typeof type === 'string') {
let c = constraints[type.toUpperCase()];
if (c) {
- 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 migrate_data
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
migrate_data(db, data_sets, callback) {
const update = function (table, sql, values) {
const v = [];
const l = table.pk().length;
Avoid deeply nested control flow statements. Open
if (oc.parse) {
str = oc.parse(m, cs, oc);
} else {
str = m[1];
cs.push(Constraint(oc));
Avoid deeply nested control flow statements. Open
if (m) {
const aname = unquote(m[1]);
const type = m[4];
ps.input = m[6];
Function Attribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function Attribute(name, type, cs) {
const constraints = [];
if (cs instanceof Array) {
- 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 Table
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function Table(name, attributes, constraints) {
for (const i in attributes) {
const a = attributes[i];
if (!(a instanceof Attribute))
- 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"