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/appcenter/web/ApplicationXPage.java 411
fr/paris/lutece/plugins/appcenter/web/ApplicationXPage.java 457
        Map<String, Object> mapStates = new HashMap<>( );
        Map<String, Object> mapHistories = new HashMap<>( );
        for ( Demand demand : listFullDemands )
        {
            String strWorkflowResourceType = DemandTypeService.getWorkflowResourceType( demand.getIdDemandType( ) );
            int nIdWorkflow = DemandTypeService.getIdWorkflow( demand.getIdDemandType( ) );
            State state = WorkflowService.getInstance( ).getState( demand.getId( ), strWorkflowResourceType, nIdWorkflow, -1 );
            mapStates.put( Integer.toString( demand.getId( ) ), state );

            String strHistoryHtml = WorkflowService.getInstance( ).getDisplayDocumentHistory( demand.getId( ), strWorkflowResourceType, nIdWorkflow, request,
                    request.getLocale( ) );
            mapHistories.put( Integer.toString( demand.getId( ) ), strHistoryHtml );
        }

        model.put( MARK_DEMANDS_STATES, mapStates );
        model.put( MARK_DEMANDS_HISTORIES, mapHistories );
        model.put( MARK_USER, UserService.getCurrentUserInAppContext( request, _application.getId( ) ) );
        
        return getXPage( TEMPLATE_MODIFY_APPLICATION, request.getLocale( ), model );
File Line
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 142
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 445
        daoUtil.setInt( 1, nKey );
        daoUtil.executeQuery( );
        Application application = null;
        List<String> listEnvironmentCode = new ArrayList<>( );
        List<Environment> listEnvironment = new ArrayList<>( );

        if ( daoUtil.next( ) )
        {

            application = new Application( );
            int nIndex = 1;

            application.setId( daoUtil.getInt( nIndex++ ) );
            application.setName( daoUtil.getString( nIndex++ ) );
            application.setDescription( daoUtil.getString( nIndex++ ) );
            OrganizationManager organizationManager = new OrganizationManager( );
            organizationManager.setIdOrganizationManager( daoUtil.getInt( nIndex++ ) );
            application.setOrganizationManager( organizationManager );
            application.setApplicationData( daoUtil.getString( nIndex++ ) );
            application.setCode( daoUtil.getString( nIndex++ ) );
            String strEnviCode = daoUtil.getString( nIndex++ );
File Line
fr/paris/lutece/plugins/appcenter/business/DemandDAO.java 95
fr/paris/lutece/plugins/appcenter/business/DemandDAO.java 184
        daoUtil.setString( nIndex++, demand.getIdUserFront( ) );
        daoUtil.setString( nIndex++, demand.getStatusText( ) );
        daoUtil.setString( nIndex++, demand.getIdDemandType( ) );
        daoUtil.setString( nIndex++, demand.getDemandType( ) );
        daoUtil.setInt( nIndex++, demand.getIdApplication( ) );
        daoUtil.setString( nIndex++, demand.getDemandData( ) );
        daoUtil.setTimestamp( nIndex++, demand.getCreationDate( ) );
        daoUtil.setBoolean( nIndex++, demand.isClosed( ) );
        if ( demand.getEnvironment( ) != null )
        {
            daoUtil.setString( nIndex++, demand.getEnvironment( ).getPrefix( ) );
        }
        else
        {
            daoUtil.setString( nIndex++, "" );
        }

        daoUtil.executeUpdate( );
File Line
fr/paris/lutece/plugins/appcenter/business/DemandTypeDAO.java 97
fr/paris/lutece/plugins/appcenter/business/DemandTypeDAO.java 274
        daoUtil.setInt( 1, nKey );
        daoUtil.executeQuery( );
        DemandType demandType = null;

        if ( daoUtil.next( ) )
        {
            demandType = new DemandType( );
            int nIndex = 1;

            demandType.setId( daoUtil.getInt( nIndex++ ) );
            demandType.setIdDemandType( daoUtil.getString( nIndex++ ) );
            demandType.setIdWorkflow( daoUtil.getInt( nIndex++ ) );
            demandType.setJavaClass( daoUtil.getString( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setDescription( daoUtil.getString( nIndex++ ) );
            demandType.setQuestion( daoUtil.getString( nIndex++ ) );
            demandType.setIdCategoryDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
        }

        daoUtil.free( );
        return demandType;
    }
File Line
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 288
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 388
        List<Application> applicationList = new ArrayList<>( );
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            Application application = new Application( );
            int nIndex = 1;

            application.setId( daoUtil.getInt( nIndex++ ) );
            application.setName( daoUtil.getString( nIndex++ ) );
            application.setDescription( daoUtil.getString( nIndex++ ) );
            OrganizationManager organizationManager = new OrganizationManager( );
            organizationManager.setIdOrganizationManager( daoUtil.getInt( nIndex++ ) );
            application.setOrganizationManager( organizationManager );
            application.setApplicationData( daoUtil.getString( nIndex++ ) );
            application.setCode( daoUtil.getString( nIndex++ ) );
            application.setIdFileLogo( daoUtil.getInt( nIndex++ ) );
File Line
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 295
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 343
            int nIndex = 1;

            application.setId( daoUtil.getInt( nIndex++ ) );
            application.setName( daoUtil.getString( nIndex++ ) );
            application.setDescription( daoUtil.getString( nIndex++ ) );
            OrganizationManager organizationManager = new OrganizationManager( );
            organizationManager.setIdOrganizationManager( daoUtil.getInt( nIndex++ ) );
            application.setOrganizationManager( organizationManager );
            application.setApplicationData( daoUtil.getString( nIndex++ ) );
            application.setCode( daoUtil.getString( nIndex++ ) );
            application.setIdFileLogo( daoUtil.getInt( nIndex++ ) );
            application.setActive( daoUtil.getBoolean( nIndex++ ) );
            
            applicationList.add( application );
        }

        daoUtil.free( );
        return applicationList;
    }

    /**
     * {@inheritDoc }
     */
    @Override
    public List<Application> selectApplicationsListByFilter( ApplicationFilter filter, Plugin plugin )
File Line
fr/paris/lutece/plugins/appcenter/service/web/task/TaskNotifyComponent.java 103
fr/paris/lutece/plugins/appcenter/service/web/task/TaskNotifyToValidateComponent.java 89
        return AppTemplateService.getTemplate( TEMPLATE_TASK_NOTIFY_CONFIG, locale, model ).getHtml( );
    }

    @Override
    public String doValidateTask( int i, String string, HttpServletRequest hsr, Locale locale, ITask itask )
    {
        return null;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String doSaveConfig( HttpServletRequest request, Locale locale, ITask task )
    {
        // In case there are no errors, then the config is created/updated
        boolean bCreate = false;
        NotifyTaskConfig config = getTaskConfigService( ).findByPrimaryKey( task.getId( ) );

        if ( config == null )
        {
            config = (NotifyTaskConfig) _taskFactory.newTaskConfig( _taskType.getKey( ) );
            if ( config != null )
            {
                config.setIdTask( task.getId( ) );
                bCreate = true;
            }
        }

        if ( config != null )
        {
File Line
fr/paris/lutece/plugins/appcenter/web/DemandTypeJspBean.java 553
fr/paris/lutece/plugins/appcenter/web/DemandTypeJspBean.java 591
        List<CategoryDemandType> listCategories = CategoryDemandTypeHome.getCategoryDemandTypesList( );

        // Find the _categorydemandtype and the before element
        ListIterator<CategoryDemandType> it = listCategories.listIterator( );
        boolean bContinue = true;
        while ( it.hasNext( ) && bContinue )
        {
            CategoryDemandType category = it.next( );

            if ( category.getId( ) == _categorydemandtype.getId( ) )
            {
                int nIndexPrevious = it.previousIndex( ) - 1;
                CategoryDemandType beforeCategory = listCategories.get( nIndexPrevious );
                int currentOrder = _categorydemandtype.getOrder( );
                _categorydemandtype.setOrder( beforeCategory.getOrder( ) );
                beforeCategory.setOrder( currentOrder );
                CategoryDemandTypeHome.update( _categorydemandtype );
                CategoryDemandTypeHome.update( beforeCategory );
                bContinue = false;
            }
        }

        return redirectView( request, VIEW_MANAGE_DEMANDTYPES );
    }

    @Action( ACTION_MOVE_CATEGORY_DEMAND_TYPE_DOWN )
File Line
fr/paris/lutece/plugins/appcenter/business/DemandTypeDAO.java 103
fr/paris/lutece/plugins/appcenter/business/DemandTypeDAO.java 250
fr/paris/lutece/plugins/appcenter/business/DemandTypeDAO.java 280
            demandType = new DemandType( );
            int nIndex = 1;

            demandType.setId( daoUtil.getInt( nIndex++ ) );
            demandType.setIdDemandType( daoUtil.getString( nIndex++ ) );
            demandType.setIdWorkflow( daoUtil.getInt( nIndex++ ) );
            demandType.setJavaClass( daoUtil.getString( nIndex++ ) );
            demandType.setLabel( daoUtil.getString( nIndex++ ) );
            demandType.setDescription( daoUtil.getString( nIndex++ ) );
            demandType.setQuestion( daoUtil.getString( nIndex++ ) );
            demandType.setIdCategoryDemandType( daoUtil.getInt( nIndex++ ) );
            demandType.setOrder( daoUtil.getInt( nIndex++ ) );
File Line
fr/paris/lutece/plugins/appcenter/web/DemandTypeJspBean.java 342
fr/paris/lutece/plugins/appcenter/web/DemandTypeJspBean.java 381
        List<DemandType> listDemandTypes = DemandTypeHome.getDemandTypesListByIdCategory( nIdCategoryDemandType );

        // Find the _categorydemandtype and the before element
        ListIterator<DemandType> it = listDemandTypes.listIterator( );
        boolean bContinue = true;
        while ( it.hasNext( ) && bContinue )
        {
            DemandType demandType = it.next( );

            if ( demandType.getId( ) == _demandtype.getId( ) )
            {
                int nIndexPrevious = it.previousIndex( ) - 1;
                DemandType beforeCategory = listDemandTypes.get( nIndexPrevious );
                int currentOrder = _demandtype.getOrder( );
                _demandtype.setOrder( beforeCategory.getOrder( ) );
                beforeCategory.setOrder( currentOrder );
                DemandTypeHome.update( _demandtype );
                DemandTypeHome.update( beforeCategory );
                bContinue = false;
            }
        }

        return redirectView( request, VIEW_MANAGE_CATEGORYDEMANDTYPES );
File Line
fr/paris/lutece/plugins/appcenter/service/web/task/TaskNotifyComponent.java 85
fr/paris/lutece/plugins/appcenter/service/web/task/TaskNotifyToValidateComponent.java 72
    }

    public String getTaskInformationXml( int i, HttpServletRequest hsr, Locale locale, ITask itask )
    {
        return null;
    }

    @Override
    public String getDisplayConfigForm( HttpServletRequest request, Locale locale, ITask task )
    {
        Map<String, Object> model = new HashMap<String, Object>( );
        NotifyTaskConfig conf = NotifyTaskConfigHome.findByPrimaryKey( task.getId( ), AppcenterPlugin.getPlugin( ) );
        if ( conf != null )
        {
            model.put( MARK_CONFIG, conf );
        }
        model.put( MARK_WEBAPP_URL, AppPathService.getBaseUrl( request ) );
File Line
fr/paris/lutece/plugins/appcenter/business/DocumentationDAO.java 151
fr/paris/lutece/plugins/appcenter/business/DocumentationDAO.java 218
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
        daoUtil.executeQuery( );

        while ( daoUtil.next( ) )
        {
            Documentation documentation = new Documentation( );
            int nIndex = 1;

            documentation.setId( daoUtil.getInt( nIndex++ ) );
            documentation.setIdDemandType( daoUtil.getInt( nIndex++ ) );
            documentation.setLabel( daoUtil.getString( nIndex++ ) );
            documentation.setUrl( daoUtil.getString( nIndex++ ) );
            documentation.setCategory( daoUtil.getString( nIndex++ ) );

            documentationList.add( documentation );
        }

        daoUtil.free( );
        return documentationList;
    }
File Line
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 343
fr/paris/lutece/plugins/appcenter/business/ApplicationDAO.java 396
            nIndex = 1;

            application.setId( daoUtil.getInt( nIndex++ ) );
            application.setName( daoUtil.getString( nIndex++ ) );
            application.setDescription( daoUtil.getString( nIndex++ ) );
            OrganizationManager organizationManager = new OrganizationManager( );
            organizationManager.setIdOrganizationManager( daoUtil.getInt( nIndex++ ) );
            application.setOrganizationManager( organizationManager );
            application.setApplicationData( daoUtil.getString( nIndex++ ) );
            application.setCode( daoUtil.getString( nIndex++ ) );
            application.setIdFileLogo( daoUtil.getInt( nIndex++ ) );