Showing 2,206 of 2,206 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
it(`should set isUK value to false when 'x-bbc-edge-isuk' is NOT 'yes'`, async () => {
mockRouteProps({
dataResponse: successDataResponse,
isAmp: true,
});
- 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 106.
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
it(`should set isUK value to true when 'x-country' is set to 'gb' and 'x-bbc-edge-isuk' is not available`, async () => {
mockRouteProps({
dataResponse: successDataResponse,
isAmp: true,
});
- 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 106.
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
it('should render empty text if the strapline is empty and is not the 1st section ', () => {
const { container } = render(
<Wrapper>
<IndexPageSection group={hasNoStrapline} sectionNumber={1} />
</Wrapper>,
- 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 106.
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 font-families.js
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
* BBC REITH
*/
const reithFallback = `Helvetica, Arial, sans-serif;`;
const reithSans = `font-family: ReithSans, ${reithFallback}`;
File index.test.jsx
has 314 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import {
isNull,
suppressPropWarnings,
} from '#psammead/psammead-test-helpers/src';
Function L
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
L = function(e, t) {
var n,
r,
o,
i,
Function kn
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
kn = function(e, t) {
var n,
r,
o,
i,
Function s
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
s = function(e, t) {
var n,
r,
o,
i,
Function O
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
O = function(e, t) {
var n,
r,
o,
i,
Function e
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function e() {
var e = this;
this.eventListener = function() {
0 === performance.getEntriesByType(Ct).length ? e.performanceNavigationEventHandlerTimingLevel1() : new PerformanceObserver((function(t) {
t.getEntries().forEach((function(t) {
Function lt
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, lt = function(e, t) {
var n,
r,
o,
i,
Function bt
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, bt = function(e, t) {
var n,
r,
o,
i,
Function C
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
C = function(e, t) {
var n,
r,
o,
i,
Function Se
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Se(e, t) {
var n,
r,
o,
i,
Function d
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
function d(e, t) {
var n,
r,
o,
i,
Function jn
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
jn = function(e, t) {
var n,
r,
o,
i,
File index.test.jsx
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { render } from '../../../../components/react-testing-library-with-providers';
import Grid from '.';
import { ExampleParagraph, ExampleFigure, ExampleImage } from './testHelpers';
File index.ts
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getEnvConfig } from '#app/lib/utilities/getEnvConfig';
import {
getDestination,
getAppType,
getScreenInfo,
Function Et
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
}, St = "CWR: Cannot dispatch; no AWS credentials.", Et = function() {
function e(e, t, n, r) {
var o = this;
this.dispatchFetch = function() {
return wt(o, void 0, void 0, (function() {
Similar blocks of code found in 4 locations. Consider refactoring. Open
<Grid
item
columns={{
group0: 6,
group1: 6,
- 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 104.
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