Fork me on GitHub

CPD Results

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

Duplications

File Line
fr/paris/lutece/plugins/workflow/modules/evaluation/business/TaskEvaluationConfigDAO.java 64
fr/paris/lutece/plugins/workflow/modules/evaluation/business/TaskEvaluationConfigDAO.java 88
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, EvaluationPlugin.getPlugin(  ) );

        int nPos = 0;

        daoUtil.setInt( ++nPos, config.getIdTask(  ) );
        daoUtil.setString( ++nPos, config.getTaskTitle(  ) );
        daoUtil.setString( ++nPos, config.getTaskDescription(  ) );
        daoUtil.setString( ++nPos, config.getSummaryTitle(  ) );
        daoUtil.setBoolean( ++nPos, config.isMandatorySummary(  ) );
        daoUtil.setString( ++nPos, config.getFinalNoteTitle(  ) );
        daoUtil.setBoolean( ++nPos, config.isMandatoryFinalNote(  ) );
        daoUtil.setBoolean( ++nPos, config.isAutomaticFinalNote(  ) );
        daoUtil.setString( ++nPos, config.getBestScoreFinalNote(  ) );

        daoUtil.executeUpdate(  );
File Line
fr/paris/lutece/plugins/workflow/modules/evaluation/business/TaskEvaluationCriteriaDAO.java 69
fr/paris/lutece/plugins/workflow/modules/evaluation/business/synthesis/SynthesisCriteriaDAO.java 324
    private int newPrimaryKey( Plugin plugin )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEW_PK, plugin );
        daoUtil.executeQuery(  );

        int nKey;

        if ( !daoUtil.next(  ) )
        {
            // if the table is empty
            nKey = 1;
        }

        nKey = daoUtil.getInt( 1 ) + 1;
        daoUtil.free(  );

        return nKey;
    }

    /**
     * Generates a new position
     * @param plugin the plugin
     * @param nIdTask the id task
     * @return The new position
     */
    private int newPosition( Plugin plugin, int nIdTask )
    {
        DAOUtil daoUtil = new DAOUtil( SQL_QUERY_NEW_POSITION, plugin );
        daoUtil.setInt( 1, nIdTask );
        daoUtil.executeQuery(  );

        int nPosition;

        if ( !daoUtil.next(  ) )
        {
            // if the table is empty
            nPosition = 1;
        }
        else
        {
            nPosition = daoUtil.getInt( 1 ) + 1;
        }

        daoUtil.free(  );

        return nPosition;
    }