DanielHreben/sequelize-transparent-cache

View on GitHub

Showing 151 of 151 total issues

Function buildAutoMethods has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildAutoMethods (client, model) {
  return {
    client () {
      return client
    },
Severity: Minor
Found in packages/sequelize-transparent-cache/src/methods/class.js - About 1 hr to fix

    Function restoreTimestamps has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function restoreTimestamps (data, instance) {
      const timestampFields = ['createdAt', 'updatedAt', 'deletedAt']
    
      for (const field of timestampFields) {
        const value = data[field]
    Severity: Minor
    Found in packages/sequelize-transparent-cache/src/cache/util.js - About 1 hr to fix

      Function buildManualMethods has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function buildManualMethods (client, model, customKey) {
        return {
          client () {
            return client
          },
      Severity: Minor
      Found in packages/sequelize-transparent-cache/src/methods/class.js - About 1 hr to fix

        Definition for rule 'jest/no-disabled-tests' was not found
        Open

        class IORedisAdaptor {

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-identical-title' was not found
        Open

        module.exports = require('./memcache-plus-adaptor')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/valid-expect' was not found
        Open

        module.exports = require('./memcache-plus-adaptor')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-disabled-tests' was not found
        Open

        module.exports = require('./variable-adaptor')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-identical-title' was not found
        Open

        module.exports = require('./variable-adaptor')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-focused-tests' was not found
        Open

        const buildClassMethods = require('./methods/class')

        For more information visit Source: http://eslint.org/docs/rules/

        'test' is not defined.
        Open

          test('findByPk', async () => {

        Disallow Undeclared Variables (no-undef)

        This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

        Rule Details

        Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

        Examples of incorrect code for this rule:

        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        Examples of correct code for this rule with global declaration:

        /*global someFunction b:true*/
        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        The b:true syntax in /*global */ indicates that assignment to b is correct.

        Examples of incorrect code for this rule with global declaration:

        /*global b*/
        /*eslint no-undef: "error"*/
        
        b = 10;

        By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

        Options

        • typeof set to true will warn for variables used inside typeof check (Default false).

        typeof

        Examples of correct code for the default { "typeof": false } option:

        /*eslint no-undef: "error"*/
        
        if (typeof UndefinedIdentifier === "undefined") {
            // do something ...
        }

        You can use this option if you want to prevent typeof check on a variable which has not been declared.

        Examples of incorrect code for the { "typeof": true } option:

        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Examples of correct code for the { "typeof": true } option with global declaration:

        /*global a*/
        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Environments

        For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

        browser

        Examples of correct code for this rule with browser environment:

        /*eslint no-undef: "error"*/
        /*eslint-env browser*/
        
        setTimeout(function() {
            alert("Hello");
        });

        node

        Examples of correct code for this rule with node environment:

        /*eslint no-undef: "error"*/
        /*eslint-env node*/
        
        var fs = require("fs");
        module.exports = function() {
            console.log(fs);
        };

        When Not To Use It

        If explicit declaration of global variables is not to your taste.

        Compatibility

        This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

        'test' is not defined.
        Open

          test('cache -> findOne', async () => {

        Disallow Undeclared Variables (no-undef)

        This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

        Rule Details

        Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

        Examples of incorrect code for this rule:

        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        Examples of correct code for this rule with global declaration:

        /*global someFunction b:true*/
        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        The b:true syntax in /*global */ indicates that assignment to b is correct.

        Examples of incorrect code for this rule with global declaration:

        /*global b*/
        /*eslint no-undef: "error"*/
        
        b = 10;

        By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

        Options

        • typeof set to true will warn for variables used inside typeof check (Default false).

        typeof

        Examples of correct code for the default { "typeof": false } option:

        /*eslint no-undef: "error"*/
        
        if (typeof UndefinedIdentifier === "undefined") {
            // do something ...
        }

        You can use this option if you want to prevent typeof check on a variable which has not been declared.

        Examples of incorrect code for the { "typeof": true } option:

        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Examples of correct code for the { "typeof": true } option with global declaration:

        /*global a*/
        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Environments

        For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

        browser

        Examples of correct code for this rule with browser environment:

        /*eslint no-undef: "error"*/
        /*eslint-env browser*/
        
        setTimeout(function() {
            alert("Hello");
        });

        node

        Examples of correct code for this rule with node environment:

        /*eslint no-undef: "error"*/
        /*eslint-env node*/
        
        var fs = require("fs");
        module.exports = function() {
            console.log(fs);
        };

        When Not To Use It

        If explicit declaration of global variables is not to your taste.

        Compatibility

        This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

        'expect' is not defined.
        Open

            expect(userFromDb.get()).toEqual(

        Disallow Undeclared Variables (no-undef)

        This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

        Rule Details

        Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

        Examples of incorrect code for this rule:

        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        Examples of correct code for this rule with global declaration:

        /*global someFunction b:true*/
        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        The b:true syntax in /*global */ indicates that assignment to b is correct.

        Examples of incorrect code for this rule with global declaration:

        /*global b*/
        /*eslint no-undef: "error"*/
        
        b = 10;

        By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

        Options

        • typeof set to true will warn for variables used inside typeof check (Default false).

        typeof

        Examples of correct code for the default { "typeof": false } option:

        /*eslint no-undef: "error"*/
        
        if (typeof UndefinedIdentifier === "undefined") {
            // do something ...
        }

        You can use this option if you want to prevent typeof check on a variable which has not been declared.

        Examples of incorrect code for the { "typeof": true } option:

        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Examples of correct code for the { "typeof": true } option with global declaration:

        /*global a*/
        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Environments

        For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

        browser

        Examples of correct code for this rule with browser environment:

        /*eslint no-undef: "error"*/
        /*eslint-env browser*/
        
        setTimeout(function() {
            alert("Hello");
        });

        node

        Examples of correct code for this rule with node environment:

        /*eslint no-undef: "error"*/
        /*eslint-env node*/
        
        var fs = require("fs");
        module.exports = function() {
            console.log(fs);
        };

        When Not To Use It

        If explicit declaration of global variables is not to your taste.

        Compatibility

        This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

        'expect' is not defined.
        Open

            expect(cacheStore.User[key]).toBeUndefined() // User was deleted from cache

        Disallow Undeclared Variables (no-undef)

        This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

        Rule Details

        Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

        Examples of incorrect code for this rule:

        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        Examples of correct code for this rule with global declaration:

        /*global someFunction b:true*/
        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        The b:true syntax in /*global */ indicates that assignment to b is correct.

        Examples of incorrect code for this rule with global declaration:

        /*global b*/
        /*eslint no-undef: "error"*/
        
        b = 10;

        By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

        Options

        • typeof set to true will warn for variables used inside typeof check (Default false).

        typeof

        Examples of correct code for the default { "typeof": false } option:

        /*eslint no-undef: "error"*/
        
        if (typeof UndefinedIdentifier === "undefined") {
            // do something ...
        }

        You can use this option if you want to prevent typeof check on a variable which has not been declared.

        Examples of incorrect code for the { "typeof": true } option:

        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Examples of correct code for the { "typeof": true } option with global declaration:

        /*global a*/
        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Environments

        For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

        browser

        Examples of correct code for this rule with browser environment:

        /*eslint no-undef: "error"*/
        /*eslint-env browser*/
        
        setTimeout(function() {
            alert("Hello");
        });

        node

        Examples of correct code for this rule with node environment:

        /*eslint no-undef: "error"*/
        /*eslint-env node*/
        
        var fs = require("fs");
        module.exports = function() {
            console.log(fs);
        };

        When Not To Use It

        If explicit declaration of global variables is not to your taste.

        Compatibility

        This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-identical-title' was not found
        Open

        const sequelize = require('./sequelize')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-identical-title' was not found
        Open

        const cache = require('../cache')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-focused-tests' was not found
        Open

        module.exports = require('./io-redis-adaptor')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/valid-expect' was not found
        Open

        module.exports = require('./io-redis-adaptor')

        For more information visit Source: http://eslint.org/docs/rules/

        Definition for rule 'jest/no-identical-title' was not found
        Open

        class IORedisAdaptor {

        For more information visit Source: http://eslint.org/docs/rules/

        'afterAll' is not defined.
        Open

        afterAll(() => memcachePlus.disconnect())

        Disallow Undeclared Variables (no-undef)

        This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

        Rule Details

        Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

        Examples of incorrect code for this rule:

        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        Examples of correct code for this rule with global declaration:

        /*global someFunction b:true*/
        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        The b:true syntax in /*global */ indicates that assignment to b is correct.

        Examples of incorrect code for this rule with global declaration:

        /*global b*/
        /*eslint no-undef: "error"*/
        
        b = 10;

        By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

        Options

        • typeof set to true will warn for variables used inside typeof check (Default false).

        typeof

        Examples of correct code for the default { "typeof": false } option:

        /*eslint no-undef: "error"*/
        
        if (typeof UndefinedIdentifier === "undefined") {
            // do something ...
        }

        You can use this option if you want to prevent typeof check on a variable which has not been declared.

        Examples of incorrect code for the { "typeof": true } option:

        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Examples of correct code for the { "typeof": true } option with global declaration:

        /*global a*/
        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Environments

        For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

        browser

        Examples of correct code for this rule with browser environment:

        /*eslint no-undef: "error"*/
        /*eslint-env browser*/
        
        setTimeout(function() {
            alert("Hello");
        });

        node

        Examples of correct code for this rule with node environment:

        /*eslint no-undef: "error"*/
        /*eslint-env node*/
        
        var fs = require("fs");
        module.exports = function() {
            console.log(fs);
        };

        When Not To Use It

        If explicit declaration of global variables is not to your taste.

        Compatibility

        This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

        'test' is not defined.
        Open

          test('set', async () => {

        Disallow Undeclared Variables (no-undef)

        This rule can help you locate potential ReferenceErrors resulting from misspellings of variable and parameter names, or accidental implicit globals (for example, from forgetting the var keyword in a for loop initializer).

        Rule Details

        Any reference to an undeclared variable causes a warning, unless the variable is explicitly mentioned in a /*global ...*/ comment.

        Examples of incorrect code for this rule:

        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        Examples of correct code for this rule with global declaration:

        /*global someFunction b:true*/
        /*eslint no-undef: "error"*/
        
        var a = someFunction();
        b = 10;

        The b:true syntax in /*global */ indicates that assignment to b is correct.

        Examples of incorrect code for this rule with global declaration:

        /*global b*/
        /*eslint no-undef: "error"*/
        
        b = 10;

        By default, variables declared in /*global */ are read-only, therefore assignment is incorrect.

        Options

        • typeof set to true will warn for variables used inside typeof check (Default false).

        typeof

        Examples of correct code for the default { "typeof": false } option:

        /*eslint no-undef: "error"*/
        
        if (typeof UndefinedIdentifier === "undefined") {
            // do something ...
        }

        You can use this option if you want to prevent typeof check on a variable which has not been declared.

        Examples of incorrect code for the { "typeof": true } option:

        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Examples of correct code for the { "typeof": true } option with global declaration:

        /*global a*/
        /*eslint no-undef: ["error", { "typeof": true }] */
        
        if(typeof a === "string"){}

        Environments

        For convenience, ESLint provides shortcuts that pre-define global variables exposed by popular libraries and runtime environments. This rule supports these environments, as listed in Specifying Environments. A few examples are given below.

        browser

        Examples of correct code for this rule with browser environment:

        /*eslint no-undef: "error"*/
        /*eslint-env browser*/
        
        setTimeout(function() {
            alert("Hello");
        });

        node

        Examples of correct code for this rule with node environment:

        /*eslint no-undef: "error"*/
        /*eslint-env node*/
        
        var fs = require("fs");
        module.exports = function() {
            console.log(fs);
        };

        When Not To Use It

        If explicit declaration of global variables is not to your taste.

        Compatibility

        This rule provides compatibility with treatment of global variables in JSHint and JSLint. Source: http://eslint.org/docs/rules/

        Severity
        Category
        Status
        Source
        Language