File metadata.ts
has 1148 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'lodash';
import PreferedCvItemsConfigDirective from './PreferedCvItemsConfigDirective';
import MetaPlaceDirective from './MetaPlaceDirective';
import {getVocabularySelectionTypes} from '../../vocabularies/constants';
import {gettext} from 'core/utils';
Function MetaTermsDirective
has a Cognitive Complexity of 92 (exceeds 5 allowed). Consider refactoring. Open
function MetaTermsDirective(metadata, $filter, $timeout, preferencesService, desks) {
return {
scope: {
item: '=',
field: '@',
- 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
Function MetaTermsDirective
has 298 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaTermsDirective(metadata, $filter, $timeout, preferencesService, desks) {
return {
scope: {
item: '=',
field: '@',
Function MetaTermsDirectiveLink
has 273 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function MetaTermsDirectiveLink(scope, elem, attrs) {
metadata.subjectScope = scope;
scope.getLocaleName = metadata.getLocaleName;
const reloadList = scope.reloadList === 'true';
const includeParent = scope.includeParent === 'true';
Function MetadataService
has 216 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MetadataService(api, subscribersService, vocabularies, $rootScope, session, $filter) {
var service = {
values: {},
helper_text: {},
popup_width: {},
Function MetadataCtrl
has 153 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetadataCtrl(
$scope, desks, metadata, privileges, datetimeHelper, userList,
preferencesService, archiveService, moment, content) {
desks.initialize();
Function MetadataCtrl
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function MetadataCtrl(
$scope, desks, metadata, privileges, datetimeHelper, userList,
preferencesService, archiveService, moment, content) {
desks.initialize();
- 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
Function MetaDropdownDirective
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function MetaDropdownDirective($filter, metadata) {
return {
scope: {
list: '=',
disabled: '=ngDisabled',
- 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
Function MetaLocatorsDirective
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
function MetaLocatorsDirective(places) {
return {
scope: {
item: '=',
fieldprefix: '@',
- 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
Function MetadataService
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
export function MetadataService(api, subscribersService, vocabularies, $rootScope, session, $filter) {
var service = {
values: {},
helper_text: {},
popup_width: {},
- 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
Function MetaLocatorsDirective
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaLocatorsDirective(places) {
return {
scope: {
item: '=',
fieldprefix: '@',
Function MetaTagsDirective
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaTagsDirective(api, $timeout) {
var ENTER = 13;
var ESC = 27;
return {
Function MetaDropdownDirective
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaDropdownDirective($filter, metadata) {
return {
scope: {
list: '=',
disabled: '=ngDisabled',
Function link
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element) {
scope.locators = [];
scope.$applyAsync(() => {
if (scope.item) {
Function link
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element) {
var inputElem = element.find('input')[0];
scope.adding = false;
scope.refreshing = false;
Function MetaTagsDirective
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
function MetaTagsDirective(api, $timeout) {
var ENTER = 13;
var ESC = 27;
return {
- 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
Function link
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, elem) {
scope.multiInputFields = ['place', 'genre', 'anpa_category', 'subject', 'authors'];
scope.getLocaleName = metadata.getLocaleName;
scope.select = function(item) {
Function MetaWordsListDirective
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaWordsListDirective() {
return {
scope: {
item: '=',
field: '@',
Function selectTerm
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.selectTerm = function(term, $event) {
// while searching, allow to search for categories but don't select them
if (scope.tree?.[term?.[scope.uniqueField]] && !scope.allowEntireCat) {
scope.openTree(term, $event);
} else if (term) {
Function link
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, element) {
scope.words = [];
scope.selectedTerm = '';
scope.$applyAsync(() => {
Function MetadropdownFocusDirective
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetadropdownFocusDirective(keyboardManager) {
return {
require: 'dropdown',
link: function(scope, elem, attrs, dropdown) {
scope.$watch(dropdown.isOpen, (isOpen) => {
Function MetaTargetedPublishingDirective
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function MetaTargetedPublishingDirective() {
return {
scope: {
list: '=',
disabled: '=ngDisabled',
Function searchTerms
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.searchTerms = function(term) {
if (!term) {
scope.terms = filterSelected(scope.list);
scope.activeList = false;
} else {
Function link
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope, elem, attrs, dropdown) {
scope.$watch(dropdown.isOpen, (isOpen) => {
if (isOpen) {
_.defer(() => {
var keyboardOptions = {inputDisabled: false, propagate: false};
Function selectLocator
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.selectLocator = function(locator) {
var updates = {};
let loc = locator;
if (!loc && scope.$ctrl.selectedTerm) {
Function MetadataCtrl
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
$scope, desks, metadata, privileges, datetimeHelper, userList,
preferencesService, archiveService, moment, content) {
Function select
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.select = function(item) {
var fieldObject: {[fieldId: string]: any} = {};
const isMultiInputField = scope.multiInputFields.includes(scope.field);
if (item) {
Function fetchMetadataValues
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchMetadataValues: function() {
var self = this;
return vocabularies.getAllActiveVocabularies().then((result) => {
_.each(result, (vocabulary) => {
Function MetaWordsListDirective
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function MetaWordsListDirective() {
return {
scope: {
item: '=',
field: '@',
- 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
Function fetchAuthors
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchAuthors: function(code) {
var self = this;
self.values.authors = [];
Function MetadropdownFocusDirective
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function MetadropdownFocusDirective(keyboardManager) {
return {
require: 'dropdown',
link: function(scope, elem, attrs, dropdown) {
scope.$watch(dropdown.isOpen, (isOpen) => {
- 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
Function MetadataService
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function MetadataService(api, subscribersService, vocabularies, $rootScope, session, $filter) {
Consider simplifying this complex logical expression. Open
if (!term) {
scope.terms = filterSelected(scope.list);
scope.activeList = false;
} else {
let searchList;
Function MetaTermsDirective
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function MetaTermsDirective(metadata, $filter, $timeout, preferencesService, desks) {
Function MetaTargetedPublishingDirective
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function MetaTargetedPublishingDirective() {
return {
scope: {
list: '=',
disabled: '=ngDisabled',
- 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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (!archiveService.isLegal($scope.item)) {
if ($scope.item.original_creator) {
userList.getUser($scope.item.original_creator)
.then((user) => {
$scope.originalCreator = user.display_name;
- 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 147.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
function setEmbargoTS(newValue, oldValue) {
if ((newValue || oldValue) && newValue !== oldValue) {
if ($scope.item.embargo_date && $scope.item.embargo_time) {
$scope.item.embargo = datetimeHelper.mergeDateTime(
$scope.item.embargo_date,
- 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 139.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
function setPublishScheduleDate(newValue, oldValue) {
if ((newValue || oldValue) && newValue !== oldValue) {
if ($scope.item.publish_schedule_date && $scope.item.publish_schedule_time) {
$scope.item.publish_schedule = datetimeHelper.mergeDateTime(
$scope.item.publish_schedule_date,
- 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 139.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
this.loaded = this.fetchMetadataValues()
.then(angular.bind(this, this.fetchSubjectcodes))
.then(angular.bind(this, this.fetchAuthors))
.then(angular.bind(this, this.fetchSubscribers))
.then(angular.bind(this, this.fetchCities))
- 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 113.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
self.values.regions = _.sortBy(self.values.geographical_restrictions,
(target) => target.value && target.value.toLowerCase() === 'all' ? '' : target.name,
);
- 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 69.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (publishSchedule) {
info = datetimeHelper.splitDateTime(publishSchedule, $scope.item.time_zone);
$scope.item.publish_schedule_date = info.date;
$scope.item.publish_schedule_time = info.time;
}
- 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 69.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
self.values.subscriberTypes = _.sortBy(self.values.subscriber_types,
(target) => target.value && target.value.toLowerCase() === 'all' ? '' : target.name,
);
- 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 69.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (embargo) {
info = datetimeHelper.splitDateTime(embargo, $scope.item.time_zone);
$scope.item.embargo_date = info.date;
$scope.item.embargo_time = info.time;
}
- 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 69.
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
Similar blocks of code found in 3 locations. Consider refactoring. Open
scope: {
list: '=',
disabled: '=ngDisabled',
item: '=',
field: '@',
- 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 61.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
search_cvs: appConfig.search_cvs || [
{id: 'subject', name: 'Subject', field: 'subject', list: 'subjectcodes'},
{id: 'companycodes', name: 'Company Codes', field: 'company_codes', list: 'company_codes'},
],
- 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 54.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
scope: {
item: '=',
fieldprefix: '@',
field: '@',
disabled: '=ngDisabled',
- 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 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
- 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