Showing 3,654 of 3,654 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
return {
getFieldV2: (fieldEditor, fieldSchema) => {
const multiple = isMultiple('locators');
const fieldConfig: IDropdownConfigVocabulary = {
- 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 431.
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
Function MonitoringGroup
has 483 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MonitoringGroup(
cards,
api,
authoringWorkspace: AuthoringWorkspaceService,
$timeout,
Function render
has 473 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {historyItems} = this.state;
if (historyItems == null) {
return null;
Function AuthoringService
has a Cognitive Complexity of 115 (exceeds 5 allowed). Consider refactoring. Open
export function AuthoringService(
$q,
$location,
api,
lock,
- 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 462 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope: IScope, elem, attrs, ctrls) {
if (scope.group == null) {
scope.group = {};
}
Function SearchResults
has a Cognitive Complexity of 113 (exceeds 5 allowed). Consider refactoring. Open
export function SearchResults(
$location,
preferencesService,
packages: IPackagesService,
asset,
- 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 render
has 449 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {contact, onChange, readOnly, errors, contactType} = this.props;
const contactLabel = contactType === 'person' ? gettext('Role') : gettext('Point of contact');
const isRequired = get(this.state, 'requiredField', false);
Function SearchParameters
has a Cognitive Complexity of 110 (exceeds 5 allowed). Consider refactoring. Open
export function SearchParameters($location, asset, tags, metadata, common, desks,
userList, ingestSources, subscribersService, $templateCache, search) {
return {
scope: {
repo: '=',
- 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 AggregateCtrl
has 433 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function AggregateCtrl($scope, desks, workspaces, preferencesService, storage,
savedSearch, content) {
const CONTENT_PROLFILE = gettext('Content profile');
var PREFERENCES_KEY = 'agg:view';
var defaultMaxItems = 10;
Similar blocks of code found in 2 locations. Consider refactoring. Open
export class Difference extends React.PureComponent<IProps> {
render() {
const value1Ids = (this.props.value1 ?? []).map(({guid}) => guid);
const value2Ids = (this.props.value2 ?? []).map(({guid}) => guid);
- 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 362.
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
export class Difference extends React.PureComponent<IProps> {
render() {
const value1Ids = (this.props.value1 ?? []).map(({id}) => id);
const value2Ids = (this.props.value2 ?? []).map(({id}) => id);
- 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 362.
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
File authoring.ts
has 844 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable newline-per-chained-call */
import {element, by, browser, protractor} from 'protractor';
import {waitHidden, waitFor, click} from './utils';
import {ECE, els, el} from '@superdesk/end-to-end-testing-helpers';
File AuthoringDirective.ts
has 824 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {sdApi} from 'api';
import {appConfig} from 'appConfig';
import {ITEM_STATE} from 'apps/archive/constants';
import {isPublished} from 'apps/archive/utils';
import {authoringApiCommon} from 'apps/authoring-bridge/authoring-api-common';
Function render
has 390 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const rundown = this.state.rundownWithChanges;
const lockedInOtherSession = rundown == null ? true : isLockedInOtherSession(rundown);
const editingDisallowed = lockedInOtherSession || this.props.readOnly;
Function SearchResults
has 389 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function SearchResults(
$location,
preferencesService,
packages: IPackagesService,
asset,
Function ChangeImageController
has 388 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ChangeImageController($scope, notify, _, api, $rootScope, $q, content) {
$scope.data = $scope.locals.data;
$scope.data.cropData = {};
$scope.validator = appConfig.validator_media_metadata;
const sizes = {};
Similar blocks of code found in 2 locations. Consider refactoring. Open
function getItemTemplate(that: Editor) {
return class SortableItemComponent extends React.PureComponent<{item: IArticle}> {
render() {
const {item} = this.props;
const {readOnly} = that.props;
- 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 340.
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 getItemTemplate(that: Editor) {
return class SortableItemComponent extends React.PureComponent<{item: IArticle}> {
render() {
const {item} = this.props;
const {readOnly} = that.props;
- 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 340.
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
File history.js
has 797 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*global angular*/
/**
* @ngdoc overview
* @name decipher.history
Function render
has 378 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {runAutomaticallyPreference, vocabularyLabels, showImagesPreference} = this.state;
if (runAutomaticallyPreference === 'loading' || vocabularyLabels == null) {
return null;