Fork me on GitHub

CPD Results

The following document contains the results of PMD's CPD 6.13.0.

Duplications

File Line
fr/paris/lutece/plugins/elasticdata/modules/appointment/service/AppointmentSlotUtil.java 124
fr/paris/lutece/plugins/elasticdata/modules/appointment/service/AppointmentSlotUtil.java 169
        int nNbWeeksToDisplay = display.getNbWeeksToDisplay( );
        if ( appointmentForm.getDateStartValidity( ) != null && startingDateOfDisplay.isBefore( appointmentForm.getDateStartValidity( ).toLocalDate( ) ) )
        {
            startingDateOfDisplay = appointmentForm.getDateStartValidity( ).toLocalDate( );
        }

        // Calculate the ending date of display with the nb weeks to display
        // since today
        // We calculate the number of weeks including the current week, so it
        // will end to the (n) next sunday
        TemporalField fieldISO = WeekFields.of( LocaleService.getDefault( ) ).dayOfWeek( );
        LocalDate dateOfSunday = startingDateOfDisplay.with( fieldISO, DayOfWeek.SUNDAY.getValue( ) );
        LocalDate endingDateOfDisplay = dateOfSunday.plusWeeks( nNbWeeksToDisplay - 1L );
        LocalDate endingValidityDate = null;
        if ( appointmentForm.getDateEndValidity( ) != null )
        {
            endingValidityDate = appointmentForm.getDateEndValidity( ).toLocalDate( );
        }
        if ( endingValidityDate != null && endingDateOfDisplay.isAfter( endingValidityDate ) )
        {
            endingDateOfDisplay = endingValidityDate;
        }