wmakeev/moysklad

View on GitHub
src/index.js

Summary

Maintainability
F
3 days
Test Coverage
A
100%

Unexpected console statement.
Open

      console.log('Warning: метод buildUri переименован в buildUrl')
Severity: Minor
Found in src/index.js by eslint

disallow the use of console (no-console)

In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using console should be stripped before being pushed to production.

console.log("Made it here.");
console.error("That shouldn't have happened.");

Rule Details

This rule disallows calls to methods of the console object.

Examples of incorrect code for this rule:

/*eslint no-console: "error"*/

console.log("Log a debug level message.");
console.warn("Log a warn level message.");
console.error("Log an error level message.");

Examples of correct code for this rule:

/*eslint no-console: "error"*/

// custom console
Console.log("Hello world!");

Options

This rule has an object option for exceptions:

  • "allow" has an array of strings which are allowed methods of the console object

Examples of additional correct code for this rule with a sample { "allow": ["warn", "error"] } option:

/*eslint no-console: ["error", { allow: ["warn", "error"] }] */

console.warn("Log a warn level message.");
console.error("Log an error level message.");

When Not To Use It

If you're using Node.js, however, console is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.

Related Rules

Unexpected console statement.
Open

      console.log('Warning: метод parseUri переименован в parseUrl')
Severity: Minor
Found in src/index.js by eslint

disallow the use of console (no-console)

In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using console should be stripped before being pushed to production.

console.log("Made it here.");
console.error("That shouldn't have happened.");

Rule Details

This rule disallows calls to methods of the console object.

Examples of incorrect code for this rule:

/*eslint no-console: "error"*/

console.log("Log a debug level message.");
console.warn("Log a warn level message.");
console.error("Log an error level message.");

Examples of correct code for this rule:

/*eslint no-console: "error"*/

// custom console
Console.log("Hello world!");

Options

This rule has an object option for exceptions:

  • "allow" has an array of strings which are allowed methods of the console object

Examples of additional correct code for this rule with a sample { "allow": ["warn", "error"] } option:

/*eslint no-console: ["error", { allow: ["warn", "error"] }] */

console.warn("Log a warn level message.");
console.error("Log an error level message.");

When Not To Use It

If you're using Node.js, however, console is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.

Related Rules

Unexpected console statement.
Open

      console.log('Warning: метод fetchUri переименован в fetchUrl')
Severity: Minor
Found in src/index.js by eslint

disallow the use of console (no-console)

In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on console. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using console should be stripped before being pushed to production.

console.log("Made it here.");
console.error("That shouldn't have happened.");

Rule Details

This rule disallows calls to methods of the console object.

Examples of incorrect code for this rule:

/*eslint no-console: "error"*/

console.log("Log a debug level message.");
console.warn("Log a warn level message.");
console.error("Log an error level message.");

Examples of correct code for this rule:

/*eslint no-console: "error"*/

// custom console
Console.log("Hello world!");

Options

This rule has an object option for exceptions:

  • "allow" has an array of strings which are allowed methods of the console object

Examples of additional correct code for this rule with a sample { "allow": ["warn", "error"] } option:

/*eslint no-console: ["error", { allow: ["warn", "error"] }] */

console.warn("Log a warn level message.");
console.error("Log an error level message.");

When Not To Use It

If you're using Node.js, however, console is used to output information to the user and so is not strictly used for debugging purposes. If you are developing for Node.js then you most likely do not want this rule enabled.

Related Rules

Identical blocks of code found in 2 locations. Consider refactoring.
Open

module.exports = stampit({
  methods: {
    getAuthHeader,

    buildUrl,
Severity: Major
Found in src/index.js and 1 other location - About 3 days to fix
bundle/umd/moysklad.js on lines 597..714

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 626.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Replace './methods/POST') with "./methods/POST");
Open

const POST = require('./methods/POST')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

  }
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/DELETE') with "./methods/DELETE");
Open

const DELETE = require('./methods/DELETE')
Severity: Minor
Found in src/index.js by eslint

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

Replace './tools/parseTimeString') with "./tools/parseTimeString");
Open

const parseTimeString = require('./tools/parseTimeString')
Severity: Minor
Found in src/index.js by eslint

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

Replace './getEnvVar.js') with "./getEnvVar.js");
Open

const getEnvVar = require('./getEnvVar.js')
Severity: Minor
Found in src/index.js by eslint

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

Replace 'opt·str' with "opt·str"
Open

    apiVersion: 'opt str'
Severity: Minor
Found in src/index.js by eslint

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

Replace 'undefined' with "undefined"
Open

  } else if (typeof fetch !== 'undefined') {
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    return version
Severity: Minor
Found in src/index.js by eslint

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

Replace './version') with "./version");
Open

const { version } = require('./version')
Severity: Minor
Found in src/index.js by eslint

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

Replace './tools/buildFilter') with "./tools/buildFilter");
Open

const buildFilter = require('./tools/buildFilter')
Severity: Minor
Found in src/index.js by eslint

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

Replace './errors') with "./errors");
Open

} = require('./errors')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    this.fetch = options.fetch
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

      _options.apiVersion = apiVersion
Severity: Minor
Found in src/index.js by eslint

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

Replace './getApiDefaultVersion') with "./getApiDefaultVersion");
Open

const getApiDefaultVersion = require('./getApiDefaultVersion')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

  )
Severity: Minor
Found in src/index.js by eslint

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

Replace './tools/getTimeString') with "./tools/getTimeString");
Open

const getTimeString = require('./tools/getTimeString')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

      return this.buildUrl(...args)
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    this.emitter = options.emitter
Severity: Minor
Found in src/index.js by eslint

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

Replace 'Warning:·метод·parseUri·переименован·в·parseUrl') with "Warning:·метод·parseUri·переименован·в·parseUrl");
Open

      console.log('Warning: метод parseUri переименован в parseUrl')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

  }
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

      return this.parseUrl(...args)
Severity: Minor
Found in src/index.js by eslint

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

Replace 'opt·str' with "opt·str"
Open

    endpoint: 'opt str',
Severity: Minor
Found in src/index.js by eslint

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

Replace '·экземпляра·библиотеки·не·указан·Fetch·API·модуль' with "·экземпляра·библиотеки·не·указан·Fetch·API·модуль"
Open

          ' экземпляра библиотеки не указан Fetch API модуль' +
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

      throw new MoyskladError(`Не указана версия ${_options.api} API`)
Severity: Minor
Found in src/index.js by eslint

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

Replace './have') with "./have");
Open

const have = require('./have')
Severity: Minor
Found in src/index.js by eslint

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

Replace './tools/buildQuery') with "./tools/buildQuery");
Open

const buildQuery = require('./tools/buildQuery')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    this.fetch = fetch
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    }
Severity: Minor
Found in src/index.js by eslint

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

Replace 'stampit') with "stampit");
Open

const stampit = require('stampit')
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/fetchUrl') with "./methods/fetchUrl");
Open

const fetchUrl = require('./methods/fetchUrl')
Severity: Minor
Found in src/index.js by eslint

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

Replace 'Warning:·метод·buildUri·переименован·в·buildUrl') with "Warning:·метод·buildUri·переименован·в·buildUrl");
Open

      console.log('Warning: метод buildUri переименован в buildUrl')
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

      return this.fetchUrl(...args)
Severity: Minor
Found in src/index.js by eslint

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

Replace 'MOYSKLAD_USER_AGENT' with "MOYSKLAD_USER_AGENT"
Open

    'MOYSKLAD_USER_AGENT',
Severity: Minor
Found in src/index.js by eslint

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

Replace 'use·strict' with "use·strict";
Open

'use strict'
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

  })
Severity: Minor
Found in src/index.js by eslint

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

Delete ·
Open

    this.fetch = function () {
Severity: Minor
Found in src/index.js by eslint

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

Delete ·
Open

  this.getOptions = function () {
Severity: Minor
Found in src/index.js by eslint

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

Replace 'undefined' with "undefined"
Open

  } else if (typeof window !== 'undefined' && window.fetch) {
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    this.fetch = window.fetch.bind(window)
Severity: Minor
Found in src/index.js by eslint

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

Replace 'Нельзя·выполнить·http·запрос,·т.к.·при·инициализации' with "Нельзя·выполнить·http·запрос,·т.к.·при·инициализации"
Open

        'Нельзя выполнить http запрос, т.к. при инициализации' +
Severity: Minor
Found in src/index.js by eslint

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

Replace 'MOYSKLAD_HOST',·'api.moysklad.ru') with "MOYSKLAD_HOST",·"api.moysklad.ru");
Open

  const MOYSKLAD_HOST = getEnvVar('MOYSKLAD_HOST', 'api.moysklad.ru')
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/PUT') with "./methods/PUT");
Open

const PUT = require('./methods/PUT')
Severity: Minor
Found in src/index.js by eslint

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

Replace 'opt·str' with "opt·str"
Open

    api: 'opt str',
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    return _options
Severity: Minor
Found in src/index.js by eslint

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

Replace 'Warning:·метод·fetchUri·переименован·в·fetchUrl') with "Warning:·метод·fetchUri·переименован·в·fetchUrl");
Open

      console.log('Warning: метод fetchUri переименован в fetchUrl')
Severity: Minor
Found in src/index.js by eslint

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

Replace 'MOYSKLAD_API',·'remap') with "MOYSKLAD_API",·"remap");
Open

  const MOYSKLAD_API = getEnvVar('MOYSKLAD_API', 'remap')
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/getAuthHeader') with "./methods/getAuthHeader");
Open

const getAuthHeader = require('./methods/getAuthHeader')
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/buildUrl') with "./methods/buildUrl");
Open

const buildUrl = require('./methods/buildUrl')
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/parseUrl') with "./methods/parseUrl");
Open

const parseUrl = require('./methods/parseUrl')
Severity: Minor
Found in src/index.js by eslint

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

Replace './methods/GET') with "./methods/GET");
Open

const GET = require('./methods/GET')
Severity: Minor
Found in src/index.js by eslint

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

Replace '·(cм.·подробнее·https://github.com/wmakeev/moysklad#Установка).' with "·(cм.·подробнее·https://github.com/wmakeev/moysklad#Установка)."
Open

          ' (cм. подробнее https://github.com/wmakeev/moysklad#Установка).'
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

      )
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

  )
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

    const apiVersion = getApiDefaultVersion(_options.api)
Severity: Minor
Found in src/index.js by eslint

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

Insert ;
Open

})
Severity: Minor
Found in src/index.js by eslint

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

Delete ·
Open

}).init(function (options) {
Severity: Minor
Found in src/index.js by eslint

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

Delete ·
Open

  this.getVersion = function () {
Severity: Minor
Found in src/index.js by eslint

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

There are no issues that match your filters.

Category
Status