Function fieldsProvider
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fieldsProvider() {
return [
{
key: 'id',
displayable: () => false,
Similar blocks of code found in 5 locations. Consider refactoring. Open
return h(LanguageSelector, {
props: {
value: props.currentValue,
},
on: {
- 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 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
- 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
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';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············displayable:·()·=>·false,
with ······displayable:·()·=>·false
Open
displayable: () => false,
- 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
import AccountService from '../services/account.service';
- 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 ········placeholder:·'John·Snow'
with placeholder:·"John·Snow"
Open
placeholder: 'John Snow',
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
return [
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············rules:·'required'
with ······rules:·"required"
Open
rules: 'required',
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············key:·'full_name'
with ······key:·"full_name"
Open
key: 'full_name',
- 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
import AccountService from '../services/account.service';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
fieldOptions: {
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- Read upRead up
- Exclude checks
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';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············key:·'id'
with ······key:·"id"
Open
key: 'id',
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- 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
import AccountService from '../services/account.service';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace '@/components/LanguageSelector'
with "@/components/LanguageSelector"
Open
import LanguageSelector from '@/components/LanguageSelector';
- 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 ············key:·'user_language'
with ······key:·"user_language"
Open
key: 'user_language',
- 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 config.fieldsProvider();
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················type:·'input',
with ········type:·"input"
Open
type: 'input',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
disableAutocomplete: true,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
// Please use ISO locales for values ISO 639-1
- 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/
Delete ····
Open
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············rules:·'required'
with ······rules:·"required"
Open
rules: 'required',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ························value:·props.currentValue,
with ············value:·props.currentValue
Open
value: props.currentValue,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····
with ··
Open
accessCheck: () => true,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········
with ····
Open
meta: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········type:·'input'
with type:·"input"
Open
type: 'input',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················frontendType:·'email',
with ········frontendType:·"email"
Open
frontendType: 'email',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················placeholder:·'******'
with ········placeholder:·"******"
Open
placeholder: '******',
- 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
route: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············label:·'field.password'
with ······label:·"field.password"
Open
label: 'field.password',
- Read upRead up
- Exclude checks
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') {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··
Open
// MUST be a function that returns a boolean
- Read upRead up
- Exclude checks
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
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ······
Open
render: (h, props) => {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················
with ········
Open
return h(LanguageSelector, {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················
with ··········
Open
on: {
- Read upRead up
- Exclude checks
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',
- 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
},
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················type:·'input'
with ········type:·"input"
Open
type: 'input',
- Read upRead up
- Exclude checks
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',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ····················props.currentValue·=·'en'
with ··········props.currentValue·=·"en"
Open
props.currentValue = 'en';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ··········
Open
props: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············label:·'settings.account'
with ······label:·"settings.account"
Open
label: 'settings.account',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············key:·'email'
with ······key:·"email"
Open
key: 'email',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
// After processing this route can be accessed via URL 'settings/example'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············rules:·'required|email'
with ······rules:·"required|email"
Open
rules: 'required|email',
- 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 ············key:·'password'
with ······key:·"password"
Open
key: 'password',
- 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
setLanguage(lang) {
- 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 ············label:·'field.email'
with ······label:·"field.email"
Open
label: 'field.email',
- 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/
Delete ······
Open
// Renderable fields array
- 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/
Delete ··············
Open
props.inputHandler(lang);
- Read upRead up
- Exclude checks
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)
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ····
Open
// After processing this route will be named as 'settings.exampleSection'
- 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
fieldOptions: {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
fieldOptions: {
- 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/
Delete ··
Open
order: 10,
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ········path:·'/settings/account'
with ····path:·"/settings/account"
Open
path: '/settings/account',
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ············
with ······
Open
get fields() {
- 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
{
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Delete ········
Open
disableAutocomplete: true,
- 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
// NOTICE: this route will not be added to VueRouter AT ALL if this check fails
- 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/
Delete ······
Open
// After render, this section will be labeled as 'Example Section'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Replace ················frontendType:·'password',
with ········frontendType:·"password"
Open
frontendType: 'password',
- 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
});
- 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
service: new AccountService(),
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/