Showing 438 of 1,408 total issues
Function getActualVsScenarioImpactTable
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getActualVsScenarioImpactTable(
dto: GetActualVsScenarioImpactTableDto,
fetchSpecification: FetchSpecification,
): Promise<ActualVsScenarioPaginatedImpactTable> {
const indicators: Indicator[] =
Function labelSelect
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const labelSelect = useMemo(() => {
if (isArray(selected) && selected?.[0]?.label) {
return (
<div className="flex flex-wrap gap-2">
{(sortBy(selected, ['label']) as Option<T>[] | Option<string>[]).map((option) => (
Function querySyncMiddleware
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const querySyncMiddleware: Middleware = () => (next) => (action) => {
const { query, isReady } = router;
if (!isReady) return next(action);
Object.entries(QUERY_PARAMS_MAP).forEach(async ([param, queryState]) => {
Function useSourcingLocationsMaterials
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function useSourcingLocationsMaterials(
params: SourcingLocationsParams,
queryOptions?: UseQueryOptions<SourcingLocationsMaterialsAPIResponse>,
): SourcingLocationsMaterialsDataResponse {
const query = useQuery<SourcingLocationsMaterialsAPIResponse>(
Function catch
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
catch(exception: Error, host: ArgumentsHost): void {
const ctx: HttpArgumentsHost = host.switchToHttp();
const response: any = ctx.getResponse();
const request: any = ctx.getRequest();
Function getMaterialMapByResolution
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getMaterialMapByResolution(
materialH3Data: H3Data,
resolution: number,
): Promise<{ materialMap: H3IndexValueData[]; quantiles: number[] }> {
const tmpTableName: string = H3DataRepository.generateRandomTableName();
Function updateImportTask
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async updateImportTask(updateTask: UpdateImportTask): Promise<Task> {
/**
* @debt
* TypeORM does not provide a friendly API to handle json fields on a UPDATE statement
* For now we are retrieving the event, update data withing the API and save it back
Function AboutPage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AboutPage: NextPage<PageProps> = () => {
return (
<ApplicationLayout>
<>
<Head>
Function main
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def main(
Function useContextualLayers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useContextualLayers = (
options: Omit<UseQueryOptions<LayerCategoriesApiResponse['data']>, 'select'> = {},
) => {
const dispatch = useAppDispatch();
return useQuery(
Function useUsers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useUsers = (
params: Record<string, unknown> = {},
options: UseQueryOptions<UserPayload> = {},
) => {
const queryOptions: UseQueryOptions<UserPayload> = {
Function ProjectedDataIcon
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function ProjectedDataIcon(props) {
return (
<svg
width={12}
height={12}
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render(): JSX.Element {
return (
<Html>
<Head>
<link rel="preconnect" href="https://fonts.gstatic.com" />
Function getAdminRegionAndGeoRegionIdByCoordinatesAndLevel
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getAdminRegionAndGeoRegionIdByCoordinatesAndLevel(
searchParams: {
lng: number;
lat: number;
level: number;
Function getRankedImpactTable
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getRankedImpactTable(
rankedImpactTableDto: GetRankedImpactTableDto,
): Promise<ImpactTable> {
const indicators: Indicator[] =
await this.indicatorService.getIndicatorsById(
Function saveChunks
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async saveChunks<Entity>(
entities: Entity[],
options?: SaveOptions,
): Promise<Entity[]> {
const queryRunner: QueryRunner = this.dataSource.createQueryRunner();
Function initializeState
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initializeState() {
this.getAttributeManager().addInstanced({
instancePositions: {
size: 3,
type: GL.DOUBLE,
Function aggregateFlows
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function aggregateFlows<F>(flows: F[], flowAccessors: FlowAccessors<F>): AggregateFlow[] {
// Sum up flows with same origin, dest
const byOriginDest = nest<F, AggregateFlow>()
.key(flowAccessors.getFlowOriginId)
.key(flowAccessors.getFlowDestId)
Function validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validate(addressInput: string, args: ValidationArguments): boolean {
if (
(args.object as SourcingDataExcelValidator).location_type ===
LOCATION_TYPES.UNKNOWN ||
(args.object as SourcingDataExcelValidator).location_type ===
Function Methodology
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Methodology: React.FC = () => {
useEffect(() => {
let timerId: number;
if (window.location.hash && document.querySelector(window.location.hash)) {