Showing 6,140 of 6,140 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
class TwitterContainer extends React.Component<FinalProps, State> {
constructor(props: FinalProps) {
super(props);
this.state = { twitterAccountId: '', accountId: '' };
- 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 498.
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 nylasController.test.ts
has 1102 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as sinon from 'sinon';
import {
accountFactory,
integrationFactory,
nylasCalendarFactory,
File plugin.js
has 1099 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* The "codemirror" plugin. It's indented to enhance the
* "sourcearea" editing mode, which displays the xhtml source code with
* syntax highlight and line numbers.
* Licensed under the MIT license
Function loadClass
has a Cognitive Complexity of 137 (exceeds 5 allowed). Consider refactoring. Open
export const loadClass = () => {
class Customer {
/**
* Checking if customer has duplicated unique properties
*/
- 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 create
has a Cognitive Complexity of 136 (exceeds 5 allowed). Consider refactoring. Open
const create = async ({
docs,
user,
contentType,
model,
- 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 loadClass
has 537 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const loadClass = () => {
class Customer {
/**
* Checking if customer has duplicated unique properties
*/
File integrationDb.test.ts
has 1059 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as momentTz from 'moment-timezone';
import {
brandFactory,
conversationFactory,
Similar blocks of code found in 2 locations. Consider refactoring. Open
export const WEBHOOK_ACTIONS = [
{ label: 'Customer created', action: 'create', type: 'customer' },
{ label: 'Customer updated', action: 'update', type: 'customer' },
{ label: 'Customer deleted', action: 'delete', type: 'customer' },
{ label: 'Company created', action: 'create', type: 'company' },
- 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 453.
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 const WEBHOOK_ACTIONS = [
{ label: 'Customer created', action: 'create', type: 'customer' },
{ label: 'Customer updated', action: 'update', type: 'customer' },
{ label: 'Customer deleted', action: 'delete', type: 'customer' },
{ label: 'Company created', action: 'create', type: 'company' },
- 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 453.
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 engageMessageDb.test.ts
has 1023 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as sinon from 'sinon';
import { MESSAGE_KINDS } from '../data/constants';
import * as utils from '../data/utils';
import {
File segments.test.ts
has 1017 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
elkConvertConditionToQuery,
fetchSegment,
generateNestedQuery,
generateQueryBySegment,
Function checkLogicFulfilled
has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring. Open
export const checkLogicFulfilled = (logics: LogicParams[]) => {
const values: { [key: string]: boolean } = {};
for (const logic of logics) {
const { fieldId, operator, logicValue, fieldValue, validation, type } = logic;
- 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
File global-styles.ts
has 971 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { injectGlobal } from 'styled-components';
import { robotAnimation } from '../utils/animations';
import { colors, typography } from './';
const style = `
File conversationMutations.test.ts
has 963 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as faker from 'faker';
import * as sinon from 'sinon';
import { AUTO_BOT_MESSAGES } from '../data/constants';
import { IntegrationsAPI } from '../data/dataSources';
import utils from '../data/utils';
File nylas.test.ts
has 951 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Nylas from 'nylas';
import * as sinon from 'sinon';
import {
configFactory,
integrationFactory,
Function main
has 470 lines of code (exceeds 25 allowed). Consider refactoring. Open
const main = async () => {
const MONGO_URL = getEnv({ name: 'MONGO_URL' });
await shelljs.exec(`mongo "${MONGO_URL}" --eval 'db.killOp()'`, {
silent: true
File loadTestData.ts
has 947 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as dotenv from 'dotenv';
import * as faker from 'faker';
import * as fs from 'fs';
import { disconnect } from 'mongoose';
import * as shelljs from 'shelljs';
Function loadClass
has 457 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const loadClass = () => {
class User {
public static async getUser(_id: string) {
const user = await Users.findOne({ _id });
Similar blocks of code found in 2 locations. Consider refactoring. Open
class ProductTypeFilter extends React.Component<IProps> {
render() {
const { history } = this.props;
const onClear = () => {
- 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 390.
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
class ProductTypeFilter extends React.Component<IProps> {
render() {
const { history } = this.props;
const onClear = () => {
- 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 390.
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