CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
273 |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
525 |
ArrayList<GreetingsCard> list = new ArrayList<GreetingsCard>( );
while ( daoUtil.next( ) )
{
GreetingsCard greetingsCard = new GreetingsCard( );
greetingsCard.setId( daoUtil.getString( 1 ) );
greetingsCard.setSenderName( daoUtil.getString( 2 ) );
greetingsCard.setSenderEmail( daoUtil.getString( 3 ) );
greetingsCard.setRecipientEmail( daoUtil.getString( 4 ) );
greetingsCard.setMessage( daoUtil.getString( 5 ) );
greetingsCard.setMessage2( daoUtil.getString( 6 ) );
greetingsCard.setDate( daoUtil.getDate( 7 ) );
greetingsCard.setIdGCT( daoUtil.getInt( 8 ) );
greetingsCard.setStatus( daoUtil.getInt( 9 ) );
greetingsCard.setCopy( daoUtil.getBoolean( 10 ) );
greetingsCard.setNotifySender( daoUtil.getBoolean( 11 ) );
list.add( greetingsCard );
}
daoUtil.free( );
return list;
} |
File |
Line |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
1088 |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
1264 |
listGreetingsCardStatistic.add( greetingsCardStatistic );
}
String[] strArrayDomain = new String[totCardsSentByDomain.keySet( ).size( )];
strArrayDomain = totCardsSentByDomain.keySet( ).toArray( strArrayDomain );
java.util.Arrays.sort( strArrayDomain );
int nTotalRead = 0;
int nTotalSent = 0;
Integer nMailSent = 0;
Integer nMailRead = 0;
for ( String strDomain : strArrayDomain )
{
nMailSent = totCardsSentByDomain.get( strDomain );
if ( nMailSent == null )
{
nMailSent = 0;
}
nMailRead = totCardsRedByDomain.get( strDomain );
if ( nMailRead == null )
{
nMailRead = 0;
}
Domain domain = new Domain( );
domain.setDomainName( strDomain );
domain.setMailSent( nMailSent );
domain.setMailRead( nMailRead );
listDomain.add( domain );
nTotalSent += nMailSent;
nTotalRead += nMailRead;
}
for ( Domain domain : listDomain )
{
domain.setTotalSent( nTotalSent );
} |
File |
Line |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
307 |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
617 |
ArrayList<GreetingsCard> list = new ArrayList<GreetingsCard>( );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
GreetingsCard greetingsCard = new GreetingsCard( );
greetingsCard.setId( daoUtil.getString( 1 ) );
greetingsCard.setSenderName( daoUtil.getString( 2 ) );
greetingsCard.setSenderEmail( daoUtil.getString( 3 ) );
greetingsCard.setRecipientEmail( daoUtil.getString( 4 ) );
greetingsCard.setDate( daoUtil.getDate( 5 ) );
greetingsCard.setIdGCT( daoUtil.getInt( 6 ) );
greetingsCard.setStatus( daoUtil.getInt( 7 ) );
greetingsCard.setCopy( daoUtil.getBoolean( 8 ) );
greetingsCard.setNotifySender( daoUtil.getBoolean( 9 ) );
list.add( greetingsCard );
}
daoUtil.free( );
return list;
} |
File |
Line |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
168 |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
278 |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardDAO.java |
530 |
greetingsCard.setId( daoUtil.getString( 1 ) );
greetingsCard.setSenderName( daoUtil.getString( 2 ) );
greetingsCard.setSenderEmail( daoUtil.getString( 3 ) );
greetingsCard.setRecipientEmail( daoUtil.getString( 4 ) );
greetingsCard.setMessage( daoUtil.getString( 5 ) );
greetingsCard.setMessage2( daoUtil.getString( 6 ) );
greetingsCard.setDate( daoUtil.getDate( 7 ) );
greetingsCard.setIdGCT( daoUtil.getInt( 8 ) );
greetingsCard.setStatus( daoUtil.getInt( 9 ) );
greetingsCard.setCopy( daoUtil.getBoolean( 10 ) );
greetingsCard.setNotifySender( daoUtil.getBoolean( 11 ) ); |
File |
Line |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
811 |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
983 |
public String getStatistics( HttpServletRequest request ) throws AccessDeniedException
{
setPageTitleProperty( PROPERTY_PAGE_TITLE_STATS );
if ( !RBACService.isAuthorized( GreetingsCardResourceIdService.RESOURCE_TYPE, RBAC.WILDCARD_RESOURCES_ID,
GreetingsCardResourceIdService.PERMISSION_SEE_STATS, (User) getUser( ) ) )
{
throw new AccessDeniedException( I18nService.getLocalizedString( MESSAGE_FORBIDEN, I18nService.getDefaultLocale( ) ) );
}
String strYear = request.getParameter( PARAM_YEAR );
int nYear = 0;
if ( strYear == null )
{
strYear = StringUtils.EMPTY;
}
else
{
try
{
nYear = Integer.parseInt( strYear );
}
catch ( NumberFormatException e )
{
nYear = 0;
}
}
if ( nYear > 0 )
{
return getAdminPage( getArchiveStatistics( request, TEMPLATE_STATISTICS, nYear ) ); |
File |
Line |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchiveDAO.java |
130 |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardArchiveDAO.java |
155 |
daoUtil.executeQuery( );
List<GreetingsCardArchive> listArchive = new ArrayList<GreetingsCardArchive>( );
while ( daoUtil.next( ) )
{
GreetingsCardArchive archive = new GreetingsCardArchive( );
archive = new GreetingsCardArchive( );
archive.setIdArchive( daoUtil.getInt( 1 ) );
archive.setIdGCT( daoUtil.getInt( 2 ) );
archive.setDomainName( daoUtil.getString( 3 ) );
archive.setNbCard( daoUtil.getInt( 4 ) );
archive.setNbCardRed( daoUtil.getInt( 5 ) );
archive.setYearArchive( daoUtil.getInt( 6 ) );
listArchive.add( archive );
}
daoUtil.free( );
return listArchive;
}
/**
* {@inheritDoc}
*/
@Override
public Collection<GreetingsCardArchive> findByYear( int year, Plugin plugin ) |
File |
Line |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplateDAO.java |
75 |
fr/paris/lutece/plugins/greetingscard/business/GreetingsCardTemplateDAO.java |
163 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_INSERT, plugin );
daoUtil.setInt( 1, greetingsCardTemplate.getId( ) );
daoUtil.setString( 2, greetingsCardTemplate.getDescription( ) );
daoUtil.setInt( 3, greetingsCardTemplate.getHeight( ) );
daoUtil.setInt( 4, greetingsCardTemplate.getWidth( ) );
if ( greetingsCardTemplate.isEnabled( ) )
{
daoUtil.setInt( 5, 1 );
}
else
{
daoUtil.setInt( 5, 0 );
}
daoUtil.setString( 6, greetingsCardTemplate.getObjectEmail( ) );
daoUtil.setString( 7, greetingsCardTemplate.getWorkgroupKey( ) );
daoUtil.executeUpdate( ); |
File |
Line |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
909 |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
1127 |
DataTableManager<Domain> tableManager = (DataTableManager<Domain>) request.getSession( ).getAttribute( PARAM_STATS_TABLE_MANAGER );
if ( tableManager == null )
{
tableManager = new DataTableManager<Domain>( url.getUrl( ), url.getUrl( ),
AppPropertiesService
.getPropertyInt( PROPERTY_DEFAULT_ITEM_PER_PAGE, CONSTANT_DEFAULT_ITEM_PER_PAGE ), true );
tableManager.addColumn( LABEL_DOMAIN_NAME, MARK_DOMAIN_NAME, true );
tableManager.addColumn( LABEL_MAIL_SEND, MARK_MAIL_SENT, true );
tableManager.addColumn( LABEL_MAIL_READ, MARK_MAIL_READ, true );
}
else
{
tableManager.setSortUrl( url.getUrl( ) );
}
DataTableManager<Domain> tableManager1 = (DataTableManager<Domain>) request.getSession( ).getAttribute("statsTableManager1" ); |
File |
Line |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardApp.java |
481 |
fr/paris/lutece/plugins/greetingscard/web/GreetingsCardJspBean.java |
1630 |
urlToViewHtmlCardFromInternet.addParameter( PARAM_PAGE, plugin.getName( ) );
urlToViewHtmlCardFromInternet.addParameter( PARAM_ACTION, PROPERTY_ACTION_VIEW );
urlToViewHtmlCardFromInternet.addParameter( PARAM_FORMAT, PROPERTY_FORMAT_HTML );
urlToViewHtmlCardFromInternet.addParameter( PARAM_GREETINGS_CARD_ID, greetingsCard.getId( ) );
HashMap<String, Object> model = new HashMap<String, Object>( );
model.put( MARK_VIEW_HTML_CARD_FROM_INTRANET, urlToViewHtmlCardFromIntranet.getUrl( ) );
model.put( MARK_VIEW_HTML_CARD_FROM_INTERNET, urlToViewHtmlCardFromInternet.getUrl( ) );
model.put( MARK_SENDER_NAME, greetingsCard.getSenderName( ) );
model.put( MARK_PORTAL_URL, strBaseUrl );
model.put( MARK_PLUGIN_NAME, plugin.getName( ) ); |