Showing 1,408 of 1,408 total issues
Similar blocks of code found in 7 locations. Consider refactoring. Open
<motion.a
className="inline-block py-5 font-semibold text-white border-2 border-white px-9"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.75, delay: 0.1 }}
- 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 68.
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 7 locations. Consider refactoring. Open
<motion.div
className="relative pt-12 md:pt-32"
initial={{ opacity: 0, y: 20 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.75, delay: 0.1 }}
- 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 68.
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
@ApiPropertyOptional({ enum: MATERIALS_ORDER_BY_VALUES })
@IsOptional()
@IsEnum(MATERIALS_ORDER_BY_VALUES, {
message: `Available columns for orderBy: ${Object.values(
MATERIALS_ORDER_BY_VALUES,
- 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 68.
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
async getGeoRegionById(id: string): Promise<GeoRegion> {
const found: GeoRegion | null = await this.geoRegionRepository.findOneBy({
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 68.
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
[INDICATOR_NAME_CODES.NCE]: {
production: () =>
`sum_material_over_georegion($1, $2, 'producer') as "${QueryPropertyNames.production}"`,
[INDICATOR_NAME_CODES.NCE]: () =>
`${get_annual_commodity_weighted_impact_over_georegion}($1, '${INDICATOR_NAME_CODES.NCE}', $2, 'producer') as "${INDICATOR_NAME_CODES.NCE}"`,
- 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 68.
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
async getIndicatorCoefficientById(id: string): Promise<IndicatorCoefficient> {
const found: IndicatorCoefficient | null =
await this.indicatorCoefficientRepository.findOneBy({ id });
if (!found) {
throw new NotFoundException(
- 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 68.
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
[INDICATOR_NAME_CODES.DF_SLUC]: {
production: () =>
`sum_material_over_georegion($1, $2, 'producer') as "${QueryPropertyNames.production}"`,
[INDICATOR_NAME_CODES.DF_SLUC]: () =>
`${get_annual_commodity_weighted_impact_over_georegion}($1, '${INDICATOR_NAME_CODES.DF_SLUC}', $2, 'producer') as "${INDICATOR_NAME_CODES.DF_SLUC}"`,
- 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 68.
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
@ApiPropertyOptional({ enum: ORDER_BY_OPTIONS })
@IsOptional()
@IsEnum(ORDER_BY_OPTIONS, {
message: `Available columns for order: ${Object.values(
ORDER_BY_OPTIONS,
- 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 68.
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
[INDICATOR_NAME_CODES.GHG_DEF_SLUC]: {
production: () =>
`sum_material_over_georegion($1, $2, 'producer') as "${QueryPropertyNames.production}"`,
[INDICATOR_NAME_CODES.GHG_DEF_SLUC]: () =>
`${get_annual_commodity_weighted_impact_over_georegion}($1,'${INDICATOR_NAME_CODES.GHG_DEF_SLUC}', $2, 'producer') as "${INDICATOR_NAME_CODES.GHG_DEF_SLUC}"`,
- 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 68.
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 activateIndicators
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async activateIndicators(
indicatorsFromSheet: CreateIndicatorDto[],
): Promise<Indicator[]> {
const nameCodesToActivateIndicatorsBy: string[] = indicatorsFromSheet
.filter((i: CreateIndicatorDto) => i.status === INDICATOR_STATUS.ACTIVE)
Function getScenarioVsScenarioImpactTable
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getScenarioVsScenarioImpactTable(
dto: GetScenarioVsScenarioImpactTableDto,
fetchSpecification: FetchSpecification,
): Promise<ScenarioVsScenarioPaginatedImpactTable> {
const indicators: Indicator[] =
Function buildQuery
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildQuery(): Query {
if (this.dto?.supplierIds) {
this.queryBuilder.andWhere(
`${EUDRAlertsFields.supplierId} IN (:...supplierIds)`,
{
Function getContextualLayerH3
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getContextualLayerH3(
contextualLayerId: string,
resolution?: number,
year?: number,
): Promise<{
Function getFlowLineAttributesByIndex
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getFlowLineAttributesByIndex(
lineAttributes: FlowLinesLayerAttributes,
index: number,
): FlowLinesLayerAttributes {
const {
Function getColors
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getColors(
diffMode: boolean,
schemeKey: string | undefined,
darkMode: boolean,
fadeEnabled: boolean,
Function CreateInterventionPage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CreateInterventionPage: React.FC = () => {
const { query } = useRouter();
const createIntervention = useCreateNewIntervention({
onSuccess: (_data, variables) => {
toast.success(`Intervention was created successfully`);
Function ChartPage
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChartPage: NextPageWithLayout = () => {
const dispatch = useAppDispatch();
const [syncedIndicators] = useSyncIndicators();
const { data, isLoading } = useIndicators(undefined, {
Function addReplacingElementsToIntervention
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async addReplacingElementsToIntervention(
newIntervention: ScenarioIntervention,
newSourcingLocations: SourcingData[],
type: SCENARIO_INTERVENTION_TYPE,
): Promise<ScenarioIntervention> {
Function addOrganisationalEntityFilters
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private addOrganisationalEntityFilters(
baseImpactMapFilters: BaseImpactMapFiltersType,
queryBuilder: { subQueryBuilder: SelectQueryBuilder<any> },
): SelectQueryBuilder<any> {
const {
Function calculateIndicatorSumByYear
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
private calculateIndicatorSumByYear(
entityMap: Map<
string,
Map<number, ScenarioVsScenarioImpactTableRowsValues>
>,