CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
162 |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
253 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
Bot bot = new Bot( );
int nIndex = 1;
bot.setId( daoUtil.getInt( nIndex++ ) );
bot.setName( daoUtil.getString( nIndex++ ) );
bot.setDescription( daoUtil.getString( nIndex++ ) );
bot.setStory( daoUtil.getString( nIndex++ ) );
bot.setDatasetId( daoUtil.getInt( nIndex++ ) );
bot.setToolsetId( daoUtil.getInt( nIndex++ ) );
bot.setModelId( daoUtil.getString( nIndex++ ) );
bot.setTypeId( daoUtil.getString( nIndex ) );
botList.add( bot );
} |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
162 |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
253 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
Dataset dataset = new Dataset( );
int nIndex = 1;
dataset.setId( daoUtil.getInt( nIndex++ ) );
dataset.setName( daoUtil.getString( nIndex++ ) );
dataset.setDescription( daoUtil.getString( nIndex++ ) );
dataset.setRecordMaxTokens( daoUtil.getInt( nIndex++ ) );
dataset.setSearchMaxRecord( daoUtil.getInt( nIndex++ ) );
dataset.setSearchMaxTokens( daoUtil.getInt( nIndex++ ) );
dataset.setMatchInstruction( daoUtil.getString( nIndex++ ) );
dataset.setMismatchInstruction( daoUtil.getString( nIndex ) );
datasetList.add( dataset );
} |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
231 |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
231 |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
231 |
fr/paris/lutece/plugins/knowledge/business/DatasetFileDAO.java |
220 |
fr/paris/lutece/plugins/knowledge/business/ToolSetAbilityDAO.java |
220 |
fr/paris/lutece/plugins/knowledge/business/ToolSetDAO.java |
211 |
List<Bot> botList = new ArrayList<>( );
StringBuilder builder = new StringBuilder( );
if ( !listIds.isEmpty( ) )
{
for ( int i = 0; i < listIds.size( ); i++ )
{
builder.append( "?," );
}
String placeHolders = builder.deleteCharAt( builder.length( ) - 1 ).toString( );
String stmt = SQL_QUERY_SELECTALL_BY_IDS + placeHolders + ")";
try ( DAOUtil daoUtil = new DAOUtil( stmt, plugin ) )
{
int index = 1;
for ( Integer n : listIds )
{
daoUtil.setInt( index++, n );
}
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{ |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
96 |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
283 |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
311 |
daoUtil.setInt( 1, nKey );
daoUtil.executeQuery( );
BotSession botSession = null;
if ( daoUtil.next( ) )
{
botSession = new BotSession( );
int nIndex = 1;
botSession.setId( daoUtil.getInt( nIndex++ ) );
botSession.setUserId( daoUtil.getInt( nIndex++ ) );
botSession.setCreationDate( daoUtil.getDate( nIndex++ ) );
botSession.setContent( daoUtil.getString( nIndex++ ) );
botSession.setBotId( daoUtil.getInt( nIndex++ ) );
botSession.setAccessCode( daoUtil.getString( nIndex++ ) );
botSession.setSessionId( daoUtil.getString( nIndex ) );
}
return Optional.ofNullable( botSession );
}
}
/**
* {@inheritDoc }
*/
@Override
public void delete( int nKey, Plugin plugin ) |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
163 |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
340 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
BotSession botSession = new BotSession( );
int nIndex = 1;
botSession.setId( daoUtil.getInt( nIndex++ ) );
botSession.setUserId( daoUtil.getInt( nIndex++ ) );
botSession.setCreationDate( daoUtil.getDate( nIndex++ ) );
botSession.setContent( daoUtil.getString( nIndex++ ) );
botSession.setBotId( daoUtil.getInt( nIndex++ ) );
botSession.setAccessCode( daoUtil.getString( nIndex++ ) );
botSession.setSessionId( daoUtil.getString( nIndex ) );
botSessionList.add( botSession );
}
return botSessionList;
}
} |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
163 |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
253 |
fr/paris/lutece/plugins/knowledge/business/BotSessionDAO.java |
340 |
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
BotSession botSession = new BotSession( );
int nIndex = 1;
botSession.setId( daoUtil.getInt( nIndex++ ) );
botSession.setUserId( daoUtil.getInt( nIndex++ ) );
botSession.setCreationDate( daoUtil.getDate( nIndex++ ) );
botSession.setContent( daoUtil.getString( nIndex++ ) );
botSession.setBotId( daoUtil.getInt( nIndex++ ) );
botSession.setAccessCode( daoUtil.getString( nIndex++ ) );
botSession.setSessionId( daoUtil.getString( nIndex ) );
botSessionList.add( botSession );
} |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
100 |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
166 |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
256 |
bot = new Bot( );
int nIndex = 1;
bot.setId( daoUtil.getInt( nIndex++ ) );
bot.setName( daoUtil.getString( nIndex++ ) );
bot.setDescription( daoUtil.getString( nIndex++ ) );
bot.setStory( daoUtil.getString( nIndex++ ) );
bot.setDatasetId( daoUtil.getInt( nIndex++ ) );
bot.setToolsetId( daoUtil.getInt( nIndex++ ) );
bot.setModelId( daoUtil.getString( nIndex++ ) );
bot.setTypeId( daoUtil.getString( nIndex ) ); |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
100 |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
166 |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
256 |
dataset = new Dataset( );
int nIndex = 1;
dataset.setId( daoUtil.getInt( nIndex++ ) );
dataset.setName( daoUtil.getString( nIndex++ ) );
dataset.setDescription( daoUtil.getString( nIndex++ ) );
dataset.setRecordMaxTokens( daoUtil.getInt( nIndex++ ) );
dataset.setSearchMaxRecord( daoUtil.getInt( nIndex++ ) );
dataset.setSearchMaxTokens( daoUtil.getInt( nIndex++ ) );
dataset.setMatchInstruction( daoUtil.getString( nIndex++ ) );
dataset.setMismatchInstruction( daoUtil.getString( nIndex ) ); |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
66 |
fr/paris/lutece/plugins/knowledge/business/BotDAO.java |
136 |
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, Statement.RETURN_GENERATED_KEYS, plugin ) )
{
int nIndex = 1;
daoUtil.setString( nIndex++, bot.getName( ) );
daoUtil.setString( nIndex++, bot.getDescription( ) );
daoUtil.setString( nIndex++, bot.getStory( ) );
daoUtil.setInt( nIndex++, bot.getDatasetId( ) );
daoUtil.setInt( nIndex++, bot.getToolsetId( ) );
daoUtil.setString( nIndex++, bot.getModelId( ) );
daoUtil.setString( nIndex++, bot.getTypeId( ) );
daoUtil.executeUpdate( ); |
File |
Line |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
66 |
fr/paris/lutece/plugins/knowledge/business/DatasetDAO.java |
136 |
try ( DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, Statement.RETURN_GENERATED_KEYS, plugin ) )
{
int nIndex = 1;
daoUtil.setString( nIndex++, dataset.getName( ) );
daoUtil.setString( nIndex++, dataset.getDescription( ) );
daoUtil.setInt( nIndex++, dataset.getRecordMaxTokens( ) );
daoUtil.setInt( nIndex++, dataset.getSearchMaxRecord( ) );
daoUtil.setInt( nIndex++, dataset.getSearchMaxTokens( ) );
daoUtil.setString( nIndex++, dataset.getMatchInstruction( ) );
daoUtil.setString( nIndex++, dataset.getMismatchInstruction( ) );
daoUtil.executeUpdate( ); |