Unexpected console statement. Open
console.log('Warning: метод buildUri переименован в buildUrl')
- Read upRead up
- Exclude checks
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 theconsole
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
- [no-alert](no-alert.md)
- [no-debugger](no-debugger.md) Source: http://eslint.org/docs/rules/
Unexpected console statement. Open
console.log('Warning: метод parseUri переименован в parseUrl')
- Read upRead up
- Exclude checks
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 theconsole
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
- [no-alert](no-alert.md)
- [no-debugger](no-debugger.md) Source: http://eslint.org/docs/rules/
Unexpected console statement. Open
console.log('Warning: метод fetchUri переименован в fetchUrl')
- Read upRead up
- Exclude checks
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 theconsole
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
- [no-alert](no-alert.md)
- [no-debugger](no-debugger.md) Source: http://eslint.org/docs/rules/
Identical blocks of code found in 2 locations. Consider refactoring. Open
module.exports = stampit({
methods: {
getAuthHeader,
buildUrl,
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Replace './methods/POST')
with "./methods/POST");
Open
const POST = require('./methods/POST')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/DELETE')
with "./methods/DELETE");
Open
const DELETE = require('./methods/DELETE')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './tools/parseTimeString')
with "./tools/parseTimeString");
Open
const parseTimeString = require('./tools/parseTimeString')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './getEnvVar.js')
with "./getEnvVar.js");
Open
const getEnvVar = require('./getEnvVar.js')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'opt·str'
with "opt·str"
Open
apiVersion: 'opt str'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'undefined'
with "undefined"
Open
} else if (typeof fetch !== 'undefined') {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return version
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './version')
with "./version");
Open
const { version } = require('./version')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './tools/buildFilter')
with "./tools/buildFilter");
Open
const buildFilter = require('./tools/buildFilter')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './errors')
with "./errors");
Open
} = require('./errors')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
this.fetch = options.fetch
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
_options.apiVersion = apiVersion
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './getApiDefaultVersion')
with "./getApiDefaultVersion");
Open
const getApiDefaultVersion = require('./getApiDefaultVersion')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './tools/getTimeString')
with "./tools/getTimeString");
Open
const getTimeString = require('./tools/getTimeString')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return this.buildUrl(...args)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
this.emitter = options.emitter
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Warning:·метод·parseUri·переименован·в·parseUrl')
with "Warning:·метод·parseUri·переименован·в·parseUrl");
Open
console.log('Warning: метод parseUri переименован в parseUrl')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return this.parseUrl(...args)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'opt·str'
with "opt·str"
Open
endpoint: 'opt str',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '·экземпляра·библиотеки·не·указан·Fetch·API·модуль'
with "·экземпляра·библиотеки·не·указан·Fetch·API·модуль"
Open
' экземпляра библиотеки не указан Fetch API модуль' +
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
throw new MoyskladError(`Не указана версия ${_options.api} API`)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './have')
with "./have");
Open
const have = require('./have')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './tools/buildQuery')
with "./tools/buildQuery");
Open
const buildQuery = require('./tools/buildQuery')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
this.fetch = fetch
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'stampit')
with "stampit");
Open
const stampit = require('stampit')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/fetchUrl')
with "./methods/fetchUrl");
Open
const fetchUrl = require('./methods/fetchUrl')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Warning:·метод·buildUri·переименован·в·buildUrl')
with "Warning:·метод·buildUri·переименован·в·buildUrl");
Open
console.log('Warning: метод buildUri переименован в buildUrl')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return this.fetchUrl(...args)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'MOYSKLAD_USER_AGENT'
with "MOYSKLAD_USER_AGENT"
Open
'MOYSKLAD_USER_AGENT',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'use·strict'
with "use·strict";
Open
'use strict'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ·
Open
this.fetch = function () {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ·
Open
this.getOptions = function () {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'undefined'
with "undefined"
Open
} else if (typeof window !== 'undefined' && window.fetch) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
this.fetch = window.fetch.bind(window)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Нельзя·выполнить·http·запрос,·т.к.·при·инициализации'
with "Нельзя·выполнить·http·запрос,·т.к.·при·инициализации"
Open
'Нельзя выполнить http запрос, т.к. при инициализации' +
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/PUT')
with "./methods/PUT");
Open
const PUT = require('./methods/PUT')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'opt·str'
with "opt·str"
Open
api: 'opt str',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
return _options
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace 'Warning:·метод·fetchUri·переименован·в·fetchUrl')
with "Warning:·метод·fetchUri·переименован·в·fetchUrl");
Open
console.log('Warning: метод fetchUri переименован в fetchUrl')
- Read upRead up
- Exclude checks
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')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/getAuthHeader')
with "./methods/getAuthHeader");
Open
const getAuthHeader = require('./methods/getAuthHeader')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/buildUrl')
with "./methods/buildUrl");
Open
const buildUrl = require('./methods/buildUrl')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/parseUrl')
with "./methods/parseUrl");
Open
const parseUrl = require('./methods/parseUrl')
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace './methods/GET')
with "./methods/GET");
Open
const GET = require('./methods/GET')
- Read upRead up
- Exclude checks
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#Установка).'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
const apiVersion = getApiDefaultVersion(_options.api)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Insert ;
Open
})
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ·
Open
}).init(function (options) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ·
Open
this.getVersion = function () {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/