cattr-app/frontend-application

View on GitHub
app/core/modules/Users/services/account.service.js

Summary

Maintainability
A
1 hr
Test Coverage

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

                    data: {
                        id: user.id,
                        password: user.password,
                        email: user.email,
                        full_name: user.full_name,
Severity: Minor
Found in app/core/modules/Users/services/account.service.js and 1 other location - About 35 mins to fix
app/core/modules/Users/services/account.service.js on lines 43..49

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

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

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

            return {
                id: values.id,
                password: values.password,
                email: values.email,
                full_name: values.full_name,
Severity: Minor
Found in app/core/modules/Users/services/account.service.js and 1 other location - About 35 mins to fix
app/core/modules/Users/services/account.service.js on lines 30..36

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

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 axios from '@/config/app';

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 axios from '@/config/app';

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 axios from '@/config/app';

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 axios from '@/config/app';

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

Replace '@/services/settings.service' with "@/services/settings.service"
Open

import SettingsService from '@/services/settings.service';

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

Delete ··
Open

    getAll() {

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 axios from '@/config/app';

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 axios from '@/config/app';

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

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

import axios from '@/config/app';

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

Delete ··
Open

    getItemRequestUri() {

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

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

        return `/auth/me`;

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

Delete ··
Open

    }

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

Replace ········let·user·=·Store.getters['user/user' with ····let·user·=·Store.getters["user/user"
Open

        let user = Store.getters['user/user'];

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

                    full_name: data.res.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 axios from '@/config/app';

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 axios from '@/config/app';

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

Replace '@/config/app' with "@/config/app"
Open

import axios from '@/config/app';

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

Replace ························user_language:·user.user_language, with ············user_language:·user.user_language
Open

                        user_language: user.user_language,

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

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

                id: values.id,

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

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

                full_name: values.full_name,

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

Delete ··
Open

        });

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

Replace '@/i18n' with "@/i18n"
Open

import i18n from '@/i18n';

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

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

            return {

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

Replace '@/store' with "@/store"
Open

import Store from '@/store';

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

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

                    data: {

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

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

                        password: user.password,

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

Delete ····
Open

        }

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

Replace ····················user_language:·data.res.user_language, with ··········user_language:·data.res.user_language
Open

                    user_language: data.res.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

        });

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 axios from '@/config/app';

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

Delete ····
Open

            const values = data.data;

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

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

                data: {

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 axios from '@/config/app';

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

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

                        id: user.id,

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

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

                        full_name: user.full_name,

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

Replace ················user_language:·values.user_language, with ··········user_language:·values.user_language
Open

                user_language: values.user_language,

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

Replace 'moment' with "moment"
Open

import moment from 'moment';

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

                    email: data.res.email,

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

Delete ····
Open

        if (Object.keys(user).length) {

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

                email: values.email,

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

                    password: data.res.password,

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

Delete ··
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 axios from '@/config/app';

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 axios from '@/config/app';

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

Delete ··
Open

    }

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

Delete ····
Open

        i18n.locale = data.user_language;

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 axios from '@/config/app';

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 axios from '@/config/app';

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 axios from '@/config/app';

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 axios from '@/config/app';

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

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

        moment.locale(data.user_language);

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

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

                    id: data.res.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 axios from '@/config/app';

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 axios from '@/config/app';

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

            Promise.resolve().then(() => {

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

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

                        email: user.email,

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

Delete ······
Open

            });

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

Replace ········return·axios.post('users/edit' with ····return·axios.post("users/edit"
Open

        return axios.post('users/edit', data).then(({ data }) => {

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 axios from '@/config/app';

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

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

                return {

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

Replace ········return·axios.get(this.getItemRequestUri(),·{·ignoreCancel:·true·}) with ····return·axios⏎······.get(this.getItemRequestUri(),·{·ignoreCancel:·true·})⏎······
Open

        return axios.get(this.getItemRequestUri(), { ignoreCancel: true }).then(({ data }) => {

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

Delete ······
Open

                password: values.password,

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

Delete ··
Open

    /**

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

Delete ····
Open

            return {

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

Delete ··
Open

    save(data) {

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

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

            };

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

There are no issues that match your filters.

Category
Status