Showing 3,654 of 3,654 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (q['$or'] != null) {
q['$or'].forEach((q1: ILogicalOperator | IComparison) => {
getQueryFieldsRecursive(q1).forEach((field) => {
fields.add(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 79.
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 (q['$and'] != null) {
q['$and'].forEach((q1: ILogicalOperator | IComparison) => {
getQueryFieldsRecursive(q1).forEach((field) => {
fields.add(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 79.
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
onClick={() => {
this.props.closeModal();
if (this.state.selectedUserId !== undefined) {
markForUserAndSend(this.state.selectedUserId);
- 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 79.
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
onClick={() => {
this.props.closeModal();
if (this.state.selectedUserId !== undefined) {
markForUser(this.state.selectedUserId);
- 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 79.
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
constructor(props) {
super(props);
this.state = {hover: false};
this.setHover = this.setHover.bind(this);
- 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 79.
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
constructor(props) {
super(props);
this.state = {open: false};
this.toggle = this.toggle.bind(this);
this.close = this.close.bind(this);
- 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 79.
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 CardsService.ts
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {flatMap, flattenDeep, includes, isNil} from 'lodash';
import {setFilters, IQueryParams} from 'apps/search/services/SearchService';
import {PUBLISHED_STATES} from 'apps/archive/constants';
import {ITEM_STATE} from 'apps/archive/constants';
import {
File menu.ts
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {reactToAngular1} from 'superdesk-ui-framework';
import {GlobalMenuHorizontal} from './GlobalMenuHorizontal';
import {appConfig} from 'appConfig';
import {addInternalEventListener} from 'core/internal-events';
import {IFullWidthPageCapabilityConfiguration} from 'superdesk-api';
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(): ReactNode {
return (
<div
style={{
marginBlockStart: 8,
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
renditions,
title,
removeButton,
Function MultiService
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function MultiService($rootScope) {
var items = [];
var self = this;
var findItem = (item) => _.find(items, (i) => i._id === item._id && i._current_version === item._current_version);
Function link
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
link: function(scope) {
scope.diff = null;
// this is triggered from MacrosController.call and apply the changes to body field
scope.$on('macro:diff', (evt, diff) => {
Function ItemLock
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ItemLock(api, lock, privileges, desks) {
return {
templateUrl: 'scripts/apps/archive/views/item-lock.html',
scope: {item: '='},
link: function(scope) {
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<Modal
visible
zIndex={1050}
Function publish
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const publish = () => {
const errors = [];
const addErrorForItem = (item, err) => {
const itemName = item.headline || item.slugline || item._id;
Function saveChanges
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
scope.saveChanges = () => {
const {user_subscriptions, desk_subscriptions} = scope.savedSearch.subscribers;
const {subscriptionInCreateOrEditMode} = scope.wrapper;
let nextUserSubscriptions = scope.savedSearch.subscribers.user_subscriptions;
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.state.selectedUser === 'loading') {
return null;
}
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.state.loading) {
return null;
}
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {groups, getToggleElement} = this.props;
const onClick = () => this.setState({open: !this.state.open});
return (
Function render
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {value, field, remove, onChange, label, readOnly, iframelyKey, onFocus, ...props} = this.props;
const showLink = this.state.title &&
!props.message &&