cattr-app/frontend-application

View on GitHub
app/core/modules/Users/sections/account.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function fieldsProvider has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function fieldsProvider() {
    return [
        {
            key: 'id',
            displayable: () => false,
Severity: Major
Found in app/core/modules/Users/sections/account.js - About 2 hrs to fix

    Similar blocks of code found in 5 locations. Consider refactoring.
    Open

                    return h(LanguageSelector, {
                        props: {
                            value: props.currentValue,
                        },
                        on: {
    Severity: Major
    Found in app/core/modules/Users/sections/account.js and 4 other locations - About 45 mins to fix
    app/core/modules/Invitations/sections/invitations.js on lines 17..26
    app/core/modules/Users/sections/users.js on lines 108..117
    app/core/modules/Users/sections/users.js on lines 147..156
    app/core/modules/Users/sections/users.js on lines 169..178

    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 50.

    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

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

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

    Replace ············displayable:·()·=>·false, with ······displayable:·()·=>·false
    Open

                displayable: () => false,

    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

    import AccountService from '../services/account.service';

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

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

            {

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

    Replace ········placeholder:·'John·Snow' with placeholder:·"John·Snow"
    Open

                    placeholder: 'John Snow',

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

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

    Replace '../services/account.service' with "../services/account.service"
    Open

    import AccountService from '../services/account.service';

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

    Delete ··
    Open

        return [

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

    Replace ············rules:·'required' with ······rules:·"required"
    Open

                rules: 'required',

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

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

    Replace ············label:·'field.full_name' with ······label:·"field.full_name"
    Open

                label: 'field.full_name',

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

    Replace ············key:·'full_name' with ······key:·"full_name"
    Open

                key: 'full_name',

    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

    import AccountService from '../services/account.service';

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

    Delete ······
    Open

                fieldOptions: {

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

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

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

    import AccountService from '../services/account.service';

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

    Replace ············key:·'id' with ······key:·"id"
    Open

                key: 'id',

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

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

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

            },

    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

    import AccountService from '../services/account.service';

    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

    import AccountService from '../services/account.service';

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

    Replace '@/components/LanguageSelector' with "@/components/LanguageSelector"
    Open

    import LanguageSelector from '@/components/LanguageSelector';

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

    Delete ····
    Open

            {

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

    Replace ············key:·'user_language' with ······key:·"user_language"
    Open

                key: 'user_language',

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

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

                        },

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

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

                    return config.fieldsProvider();

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

    Replace ················type:·'input', with ········type:·"input"
    Open

                    type: 'input',

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

    Delete ········
    Open

                    disableAutocomplete: true,

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

    Delete ····
    Open

            // Please use ISO locales for values ISO 639-1

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

    Replace ············}, with ······}
    Open

                },

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

    Delete ····
    Open

            },

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

    Replace ············rules:·'required' with ······rules:·"required"
    Open

                rules: 'required',

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

    Replace ························value:·props.currentValue, with ············value:·props.currentValue
    Open

                            value: props.currentValue,

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

    Replace ···· with ··
    Open

        accessCheck: () => true,

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

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

            meta: {

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

    Replace ········type:·'input' with type:·"input"
    Open

                    type: 'input',

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

    Replace ················frontendType:·'email', with ········frontendType:·"email"
    Open

                    frontendType: 'email',

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

    Replace ················placeholder:·'******' with ········placeholder:·"******"
    Open

                    placeholder: '******',

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

    Replace ········}, with ····}
    Open

            },

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

    Replace ···· with ··
    Open

        route: {

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

    Replace ············label:·'field.password' with ······label:·"field.password"
    Open

                label: 'field.password',

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

    Replace ········if·(typeof·props.currentValue·===·'object' with if·(typeof·props.currentValue·===·"object"
    Open

                    if (typeof props.currentValue === 'object') {

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

    Delete ··
    Open

        // MUST be a function that returns a boolean

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

    Delete ······
    Open

                // Service class to gather the data from API, should be an instance of Resource class

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

    Replace ················placeholder:·'user@email.com' with ········placeholder:·"user@email.com"
    Open

                    placeholder: 'user@email.com',

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

    Delete ······
    Open

                render: (h, props) => {

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

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

                    return h(LanguageSelector, {

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

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

                        on: {

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

    Replace ········name:·'settings.user.account' with ····name:·"settings.user.account"
    Open

            name: 'settings.user.account',

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

    Replace ········}, with ····}
    Open

            },

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

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

            },

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

    Replace ················type:·'input' with ········type:·"input"
    Open

                    type: 'input',

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

    Replace ············label:·'field.user_language' with ······label:·"field.user_language"
    Open

                label: 'field.user_language',

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

    Replace ····················props.currentValue·=·'en' with ··········props.currentValue·=·"en"
    Open

                        props.currentValue = 'en';

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

    Delete ··········
    Open

                        props: {

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

    Replace ············label:·'settings.account' with ······label:·"settings.account"
    Open

                label: 'settings.account',

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

    Replace ············key:·'email' with ······key:·"email"
    Open

                key: 'email',

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

    Delete ····
    Open

            // After processing this route can be accessed via URL 'settings/example'

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

    Replace ············rules:·'required|email' with ······rules:·"required|email"
    Open

                rules: 'required|email',

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

    Delete ····
    Open

            {

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

    Replace ············key:·'password' with ······key:·"password"
    Open

                key: 'password',

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

    Replace ············}, with ······}
    Open

                },

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

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

                            setLanguage(lang) {

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

    Replace ··}, with }
    Open

        },

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

    Replace ············label:·'field.email' with ······label:·"field.email"
    Open

                label: 'field.email',

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

    Replace ············}, with ······}
    Open

                },

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

    Delete ······
    Open

                // Renderable fields array

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

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

            {

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

    Delete ··············
    Open

                                props.inputHandler(lang);

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

    Delete ··
    Open

        // Check if this section can be rendered and accessed, this param IS OPTIONAL (true by default)

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

    Delete ····
    Open

            // After processing this route will be named as 'settings.exampleSection'

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

    Replace ············}, with ······}
    Open

                },

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

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

                fieldOptions: {

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

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

                fieldOptions: {

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

    Replace ············}, with }
    Open

                            },

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

    Delete ··
    Open

        order: 10,

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

    Replace ········path:·'/settings/account' with ····path:·"/settings/account"
    Open

            path: '/settings/account',

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

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

                get fields() {

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

    Replace ······}, with }
    Open

                },

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

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

            {

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

    Delete ········
    Open

                    disableAutocomplete: true,

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

    Delete ····
    Open

            },

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

    Delete ··
    Open

        // NOTICE: this route will not be added to VueRouter AT ALL if this check fails

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

    Replace ····················}, with ··········}
    Open

                        },

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

    Delete ······
    Open

                // After render, this section will be labeled as 'Example Section'

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

    Replace ················frontendType:·'password', with ········frontendType:·"password"
    Open

                    frontendType: 'password',

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

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

                    }

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

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

                    });

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

    Delete ··
    Open

        ];

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

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

                service: new AccountService(),

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

    There are no issues that match your filters.

    Category
    Status