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/crm/business/demand/DemandTypeDAO.java 117
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 205
            daoUtil.setInt( nIndex++, demandType.getIdDemandType( ) );
            daoUtil.setString( nIndex++, demandType.getLabel( ) );
            daoUtil.setString( nIndex++, demandType.getUrlResource( ) );
            daoUtil.setString( nIndex++, demandType.getUrlInfo( ) );
            daoUtil.setString( nIndex++, demandType.getUrlContact( ) );
            daoUtil.setInt( nIndex++, demandType.getOrder( ) );
            daoUtil.setInt( nIndex++, demandType.getIdCategory( ) );

            Date dateBegin = null;

            if ( demandType.getDateBegin( ) != null )
            {
                dateBegin = new Date( demandType.getDateBegin( ).getTime( ) );
            }

            Date dateEnd = null;

            if ( demandType.getDateEnd( ) != null )
            {
                dateEnd = new Date( demandType.getDateEnd( ).getTime( ) );
            }

            daoUtil.setDate( nIndex++, dateBegin );
            daoUtil.setDate( nIndex++, dateEnd );
            daoUtil.setString( nIndex++, demandType.getWorkgroup( ) );
            daoUtil.setString( nIndex++, demandType.getRole( ) );
            daoUtil.setInt( nIndex++, demandType.getTarget( ).getId( ) );
            daoUtil.setString( nIndex++, demandType.getUrlDelete( ) );
            daoUtil.setBoolean( nIndex++, demandType.isIncludeIdCrmUser( ) );
            daoUtil.setBoolean( nIndex++, demandType.isNeedAuthentication( ) );
            daoUtil.setBoolean( nIndex++, demandType.isNeedValidation( ) );

            daoUtil.executeUpdate( );
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 267
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 420
        DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ), plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            int nIndex = 1;
            DemandType demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );

            listDemandTypes.add( demandType );
        }

        daoUtil.free( );

        return listDemandTypes;
    }

    /**
     * {@inheritDoc}
     */
    public List<DemandType> selectByIdCategoryAndDate( int nIdCategory, java.util.Date dateToday, Plugin plugin )
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 267
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 459
        DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ), plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            int nIndex = 1;
            DemandType demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );

            listDemandTypes.add( demandType );
        }

        daoUtil.free( );

        return listDemandTypes;
    }
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 420
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 459
        setFilterValues( dtFilter, daoUtil );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            int nIndex = 1;
            DemandType demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );

            listDemandTypes.add( demandType );
        }

        daoUtil.free( );

        return listDemandTypes;
    }
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 164
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 354
        daoUtil.setInt( 1, nIdDemandType );
        daoUtil.executeQuery( );

        DemandType demandType = null;

        if ( daoUtil.next( ) )
        {
            int nIndex = 1;
            demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );
        }

        daoUtil.free( );

        return demandType;
    }

    /**
     * {@inheritDoc}
     */
    public void store( DemandType demandType, Plugin plugin )
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 272
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 320
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 425
            int nIndex = 1;
            DemandType demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );

            listDemandTypes.add( demandType );
        }

        daoUtil.free( );

        return listDemandTypes;
    }

    /**
     * {@inheritDoc}
     */
    public List<DemandType> selectByIdCategoryAndDate( int nIdCategory, java.util.Date dateToday, Plugin plugin )
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 320
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 464
            nIndex = 1;

            DemandType demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );

            listDemandTypes.add( demandType );
        }

        daoUtil.free( );

        return listDemandTypes;
    }
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 172
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 273
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 322
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 362
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 426
fr/paris/lutece/plugins/crm/business/demand/DemandTypeDAO.java 465
            demandType = new DemandType( );
            demandType.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setUrlResource( daoUtil.getString( nIndex++ ) );
            demandType.setUrlInfo( daoUtil.getString( nIndex++ ) );
            demandType.setUrlContact( daoUtil.getString( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
            demandType.setIdCategory( daoUtil.getInt( nIndex++ ) );
            demandType.setDateBegin( daoUtil.getDate( nIndex++ ) );
            demandType.setDateEnd( daoUtil.getDate( nIndex++ ) );
            demandType.setWorkgroup( daoUtil.getString( nIndex++ ) );
            demandType.setRole( daoUtil.getString( nIndex++ ) );
            demandType.setTarget( TargetEnum.getTarget( daoUtil.getInt( nIndex++ ) ) );
            demandType.setUrlDelete( daoUtil.getString( nIndex++ ) );
            demandType.setIncludeIdCrmUser( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedAuthentication( daoUtil.getBoolean( nIndex++ ) );
            demandType.setNeedValidation( daoUtil.getBoolean( nIndex++ ) );
File Line
fr/paris/lutece/plugins/crm/business/user/CRMUserDAO.java 124
fr/paris/lutece/plugins/crm/business/user/CRMUserDAO.java 164
        daoUtil.setInt( 1, nIdCRMUser );
        daoUtil.executeQuery( );

        CRMUser user = null;

        if ( daoUtil.next( ) )
        {
            int nIndex = 1;
            user = new CRMUser( );
            user.setIdCRMUser( daoUtil.getInt( nIndex++ ) );
            user.setUserGuid( daoUtil.getString( nIndex++ ) );
            user.setStatus( daoUtil.getInt( nIndex++ ) );
            user.setMustBeUpdated( daoUtil.getBoolean( nIndex++ ) );
            try
            {
                Timestamp dateLastLogin = daoUtil.getTimestamp( nIndex++ );

                if ( ( dateLastLogin != null ) && !dateLastLogin.equals( CRMUser.DEFAULT_DATE_LAST_LOGIN ) )
                {
                    user.setDateLastLogin( dateLastLogin );
                }
            }
            catch( Exception e )
            {
                user.setDateLastLogin( null );
            }
        }

        daoUtil.free( );

        return user;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public CRMUser loadByUserGuid( String strUserGuid, Plugin plugin )
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 138
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 170
            daoUtil.setInt( 1, nIdDemand );
            daoUtil.executeQuery( );

            Demand demand = null;

            if ( daoUtil.next( ) )
            {
                int nIndex = 1;
                demand = new Demand( );
                demand.setIdDemand( daoUtil.getInt( nIndex++ ) );
                demand.setIdDemandType( daoUtil.getInt( nIndex++ ) );
                demand.setIdCRMUser( daoUtil.getInt( nIndex++ ) );
                demand.setStatusText( daoUtil.getString( nIndex++ ) );
                demand.setIdStatusCRM( daoUtil.getInt( nIndex++ ) );
                demand.setData( daoUtil.getString( nIndex++ ) );
                demand.setDateModification( daoUtil.getTimestamp( nIndex++ ) );
                demand.setRemoteId( daoUtil.getString( nIndex++ ) );
            }

            return demand;
        }
    }
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 240
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 278
            daoUtil.executeQuery( );

            while ( daoUtil.next( ) )
            {
                int nIndex = 1;
                Demand demand = new Demand( );
                demand.setIdDemand( daoUtil.getInt( nIndex++ ) );
                demand.setIdDemandType( daoUtil.getInt( nIndex++ ) );
                demand.setIdCRMUser( daoUtil.getInt( nIndex++ ) );
                demand.setStatusText( daoUtil.getString( nIndex++ ) );
                demand.setIdStatusCRM( daoUtil.getInt( nIndex++ ) );
                demand.setData( daoUtil.getString( nIndex++ ) );
                demand.setDateModification( daoUtil.getTimestamp( nIndex++ ) );
                demand.setRemoteId( daoUtil.getString( nIndex++ ) );

                listDemands.add( demand );
            }
File Line
fr/paris/lutece/plugins/crm/business/notification/NotificationDAO.java 204
fr/paris/lutece/plugins/crm/business/notification/NotificationDAO.java 238
        DAOUtil daoUtil = new DAOUtil( sbSQL.toString( ), plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            int nIndex = 1;
            Notification notification = new Notification( );
            notification.setIdNotification( daoUtil.getInt( nIndex++ ) );
            notification.setIdDemand( daoUtil.getInt( nIndex++ ) );
            notification.setIsRead( daoUtil.getBoolean( nIndex++ ) );
            notification.setObject( daoUtil.getString( nIndex++ ) );
            notification.setMessage( daoUtil.getString( nIndex++ ) );
            notification.setDateCreation( daoUtil.getTimestamp( nIndex++ ) );
            notification.setSender( daoUtil.getString( nIndex++ ) );
            listNotifications.add( notification );
        }

        daoUtil.free( );

        return listNotifications;
    }
File Line
fr/paris/lutece/plugins/crm/business/user/CRMUserDAO.java 132
fr/paris/lutece/plugins/crm/business/user/CRMUserDAO.java 172
fr/paris/lutece/plugins/crm/business/user/CRMUserDAO.java 245
            user = new CRMUser( );
            user.setIdCRMUser( daoUtil.getInt( nIndex++ ) );
            user.setUserGuid( daoUtil.getString( nIndex++ ) );
            user.setStatus( daoUtil.getInt( nIndex++ ) );
            user.setMustBeUpdated( daoUtil.getBoolean( nIndex++ ) );
            try
            {
                Timestamp dateLastLogin = daoUtil.getTimestamp( nIndex++ );

                if ( ( dateLastLogin != null ) && !dateLastLogin.equals( CRMUser.DEFAULT_DATE_LAST_LOGIN ) )
                {
                    user.setDateLastLogin( dateLastLogin );
                }
            }
            catch( Exception e )
            {
                user.setDateLastLogin( null );
            }
File Line
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 146
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 179
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 245
fr/paris/lutece/plugins/crm/business/demand/DemandDAO.java 283
                demand = new Demand( );
                demand.setIdDemand( daoUtil.getInt( nIndex++ ) );
                demand.setIdDemandType( daoUtil.getInt( nIndex++ ) );
                demand.setIdCRMUser( daoUtil.getInt( nIndex++ ) );
                demand.setStatusText( daoUtil.getString( nIndex++ ) );
                demand.setIdStatusCRM( daoUtil.getInt( nIndex++ ) );
                demand.setData( daoUtil.getString( nIndex++ ) );
                demand.setDateModification( daoUtil.getTimestamp( nIndex++ ) );
                demand.setRemoteId( daoUtil.getString( nIndex++ ) );