cattr-app/frontend-application

View on GitHub
app/core/i18n/pluralizationRules.js

Summary

Maintainability
A
1 hr
Test Coverage

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;
Severity: Minor
Found in app/core/i18n/pluralizationRules.js - About 55 mins to fix

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;
Severity: Major
Found in app/core/i18n/pluralizationRules.js - About 30 mins to fix

    Definition for rule 'vue/attributes-order' was not found
    Open

    module.exports = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            if (choicesLength < 4) {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ········ with ····
    Open

            if (!teen && choice % 10 >= 2 && choice % 10 <= 4) {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ········ with ····
    Open

            }
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ············ with ······
    Open

                return 1;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ··}, with }
    Open

        },
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ··
    Open

        /**
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ········ with ····
    Open

            }
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ············ with ······
    Open

                return !teen && endsWithOne ? 1 : 2;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            if (!teen && endsWithOne) {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            return choicesLength < 4 ? 2 : 3;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ········ with ····
    Open

            const endsWithOne = choice % 10 === 1;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ······
    Open

                return 0;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            const teen = choice > 10 && choice < 20;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            }
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ··ru:·function· with ru:·function
    Open

        ru: function (choice, choicesLength) {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Replace ········ with ····
    Open

            if (choice === 0) {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            }
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ····
    Open

            // this === VueI18n instance, so the locale property also exists here
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

    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 = {
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    Delete ······
    Open

                return 2;
    Severity: Minor
    Found in app/core/i18n/pluralizationRules.js by eslint

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

    There are no issues that match your filters.

    Category
    Status