Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 5.5.1.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/aot/modules/declarationimmat/utils/CalculUtils.java 127
fr/paris/lutece/plugins/aot/modules/declarationimmat/utils/CalculUtils.java 189
    public static Integer nbHalfDaysBetweenTwoDate( String date1, String heure1, String date2, String heure2 ) throws ParseException
    {
        Calendar calendar = Calendar.getInstance( );

        calendar.setTime( org.apache.commons.lang3.time.DateUtils.parseDate( date1, "dd/MM/yyyy HH:mm:ss", "dd/MM/yyyy", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" ) );
        ZonedDateTime first = ZonedDateTime.of( calendar.get( Calendar.YEAR ), calendar.get( Calendar.MONTH ) + 1, calendar.get( Calendar.DAY_OF_MONTH ), calendar.get( Calendar.HOUR_OF_DAY ),
                calendar.get( Calendar.MINUTE ), 0, 0, ZoneId.of( "Europe/Paris" ) );

        if ( StringUtils.isNotBlank( date2 ) )
        {
            calendar.setTime( org.apache.commons.lang3.time.DateUtils.parseDate( date2, "dd/MM/yyyy HH:mm:ss", "dd/MM/yyyy", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" ) );
        }
        ZonedDateTime second = ZonedDateTime.of( calendar.get( Calendar.YEAR ), calendar.get( Calendar.MONTH ) + 1, calendar.get( Calendar.DAY_OF_MONTH ), calendar.get( Calendar.HOUR_OF_DAY ),
                calendar.get( Calendar.MINUTE ), 0, 0, ZoneId.of( "Europe/Paris" ) );

        int nbBusinessDay = 0;

        boolean isMorning = getHours( heure2 ) < MIDDAY || ( getHours( heure2 ) == MIDDAY && getMinutes( heure2 ) <= MIDDAY_MINUTE );
        boolean isAfterNoon = getHours( heure1 ) > MIDDAY || ( getHours( heure1 ) == MIDDAY && getMinutes( heure1 ) >= MIDDAY_MINUTE );

        if ( first.truncatedTo( ChronoUnit.DAYS ).equals( second.truncatedTo( ChronoUnit.DAYS ) ) )
        {
            // Same Day

            if ( ( getHours( heure2 ) >= 9 && isMorning ) || ( isAfterNoon && getHours( heure1 ) <= ENDDAY ) )
Fichier Ligne
fr/paris/lutece/plugins/aot/modules/declarationimmat/utils/CalculUtils.java 89
fr/paris/lutece/plugins/aot/modules/declarationimmat/utils/CalculUtils.java 127
fr/paris/lutece/plugins/aot/modules/declarationimmat/utils/CalculUtils.java 189
    public static Integer nbBusinessDaysBetweenTwoDate( String date1, String heure1, String date2, String heure2 ) throws ParseException
    {
        Calendar calendar = Calendar.getInstance( );

        calendar.setTime( org.apache.commons.lang3.time.DateUtils.parseDate( date1, "dd/MM/yyyy HH:mm:ss", "dd/MM/yyyy", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" ) );
        ZonedDateTime first = ZonedDateTime.of( calendar.get( Calendar.YEAR ), calendar.get( Calendar.MONTH ) + 1, calendar.get( Calendar.DAY_OF_MONTH ), calendar.get( Calendar.HOUR_OF_DAY ),
                calendar.get( Calendar.MINUTE ), 0, 0, ZoneId.of( "Europe/Paris" ) );

        if ( StringUtils.isNotBlank( date2 ) )
        {
            calendar.setTime( org.apache.commons.lang3.time.DateUtils.parseDate( date2, "dd/MM/yyyy HH:mm:ss", "dd/MM/yyyy", "yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd" ) );
        }
        ZonedDateTime second = ZonedDateTime.of( calendar.get( Calendar.YEAR ), calendar.get( Calendar.MONTH ) + 1, calendar.get( Calendar.DAY_OF_MONTH ), calendar.get( Calendar.HOUR_OF_DAY ),
                calendar.get( Calendar.MINUTE ), 0, 0, ZoneId.of( "Europe/Paris" ) );

        int nbBusinessDay = 0;