Function ru
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
ru: function (choice, choicesLength) {
// this === VueI18n instance, so the locale property also exists here
if (choice === 0) {
return 0;
- 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
Avoid too many return
statements within this function. Open
return choicesLength < 4 ? 2 : 3;
Definition for rule 'vue/attributes-order' was not found Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
if (choicesLength < 4) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
if (!teen && choice % 10 >= 2 && choice % 10 <= 4) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
return 1;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··},
with }
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
/**
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
return !teen && endsWithOne ? 1 : 2;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
if (!teen && endsWithOne) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
return choicesLength < 4 ? 2 : 3;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
const endsWithOne = choice % 10 === 1;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
return 0;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
const teen = choice > 10 && choice < 20;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ··ru:·function·
with ru:·function
Open
ru: function (choice, choicesLength) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
if (choice === 0) {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
}
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
// this === VueI18n instance, so the locale property also exists here
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Use the latest vue-eslint-parser. See also https://github.com/vuejs/eslint-plugin-vue#what-is-the-use-the-latest-vue-eslint-parser-error Open
module.exports = {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
return 2;
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/