Showing 438 of 1,408 total issues
Function useBottomScrollListener
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useBottomScrollListener<T extends HTMLDivElement>(
onBottom: () => void,
scrollref?: MutableRefObject<HTMLDivElement | null>,
options?: {
offset?: number;
Function DatesRange
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DatesRange = (): JSX.Element => {
const dispatch = useAppDispatch();
const {
filters: { dates },
} = useAppSelector(eudr);
Function findSourcingLocationsWithSourcingRecords
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
async findSourcingLocationsWithSourcingRecords(
createInterventionDto: CreateScenarioInterventionDto,
): Promise<SourcingLocation[]> {
const queryBuilder: SelectQueryBuilder<SourcingLocation> =
this.sourcingLocationRepository
Function getImpactRawDataForAllSourcingRecords
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
async getImpactRawDataForAllSourcingRecords(
activeIndicators: Indicator[],
): Promise<SourcingRecordsWithIndicatorRawData[]> {
const { params, query } = this.dependencyManager.buildQueryForImport(
activeIndicators.map(
File component.tsx
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { FC, useState } from 'react';
import cx from 'classnames';
import Image from 'next/image';
import FadeIn from 'components/fade';
Function postProcessYearIndicatorData
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private postProcessYearIndicatorData(
entityMap: Map<string, Map<number, ActualVsScenarioImpactTableRowsValues>>,
rangeOfYears: number[],
lastYearWithData: number,
): void {
- 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 geoCodeAggregationPoint
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async geoCodeAggregationPoint(sourcingData: SourcingData): Promise<any> {
/**
* The user must specify a country, and either an address OR coordinates
*/
if (this.hasBothAddressAndCoordinates(sourcingData))
- 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 relateSourcingDataWithOrganizationalEntities
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
async relateSourcingDataWithOrganizationalEntities(
suppliers: Supplier[],
businessUnits: Record<string, any>[],
materials: Material[],
sourcingData: SourcingData[],
- 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 component.tsx
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { useCallback, useMemo, useState } from 'react';
import { useRouter } from 'next/router';
import { omit } from 'lodash-es';
import {
LineChart,
Function _getFlowLayerPickingInfo
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
private async _getFlowLayerPickingInfo(
info: Record<string, any>,
): Promise<FlowLayerPickingInfo<L, F> | undefined> {
const { index, sourceLayer } = info;
const { dataProvider, accessors } = this.state || {};
Function chartData
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
const chartData = useMemo(() => {
const {
indicatorShortName,
rows,
yearSum,
Function comparisonColumn
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
<Mode extends ComparisonMode>(year: number): ColumnDefinition<ImpactRowType<Mode>> => {
const valueIsComparison = (
value: ImpactTableValueItem<ComparisonMode>,
): value is ImpactTableValueItem<true> => {
return !isScenarioComparison && isComparison;
Function buildActualVsScenarioImpactTable
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildActualVsScenarioImpactTable(
queryDto: GetActualVsScenarioImpactTableDto,
indicators: Indicator[],
dataForImpactTable: ActualVsScenarioImpactTableData[],
entityTree: ImpactTableEntityType[],
Function buildImpactTable
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
private buildImpactTable(
queryDto: GetScenarioVsScenarioImpactTableDto,
indicators: Indicator[],
dataForImpactTable: ScenarioVsScenarioImpactTableData[],
entityTree: ImpactTableEntityType[],
Function Step01
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Step01: React.FC = () => {
return (
<article
className={cx({
'flex flex-col lg:flex-row justify-between space-y-10 lg:space-x-10 lg:space-y-0': true,
Function Hero
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Hero() {
return (
<div
className={cx({
'relative px-4 pt-20 xl:pt-24 xl:pb-40 2xl:pt-32 2xl:pb-60': true,
Function postProcessYearIndicatorData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private postProcessYearIndicatorData(
entityMap: Map<
string,
Map<number, ScenarioVsScenarioImpactTableRowsValues>
>,
- 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 baseGetImpactMap
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private async baseGetImpactMap(
baseImpactMap: BaseImpactMap,
): Promise<{ impactMap: H3IndexValueData[]; quantiles: number[] }> {
let baseMapQuery: SelectQueryBuilder<any> = this.baseMapQuery(
baseImpactMap.indicatorId,
- 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 geoCodeLocations
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
async geoCodeLocations(
sourcingData: SourcingData[],
): Promise<{ geoCodedSourcingData: SourcingData[]; errors: any[] }> {
this.logger.log(
`Geocoding locations for ${sourcingData.length} sourcing record elements`,
- 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 paramsToQueryInjector
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const paramsToQueryInjector = (
params: string[],
query: string,
): string => {
while (query.includes('$')) {
- 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"