CPD Results
The following document contains the results of PMD's CPD 6.13.0.
Duplications
File |
Line |
fr/paris/lutece/plugins/gru/web/actions/groups/builders/impl/AppointmentsActionGroupBuilder.java |
57 |
fr/paris/lutece/plugins/gru/web/actions/groups/builders/impl/DemandsActionGroupBuilder.java |
56 |
List<Demand> listDemands = DemandService.getDemandsIncludingTypes( customer, getIncludedTypesList( ), user );
String strBadgeColor = null;
for ( Demand demand : listDemands )
{
ActionItem item = new ActionItem( );
item.setTitle( demand.getTitle( ) + " " + demand.getReference( ) );
item.setLink( buildDemandManagementLink( demand.getId( ), demand.getTypeId( ), customer.getId( ) ) );
item.setColor( processItemColor( demand, COLOR_PRIMARY ) );
group.addActionItem( item );
strBadgeColor = processGroupBadgeColor( demand, strBadgeColor, COLOR_PRIMARY );
}
group.setTitle( getTitle( ) );
group.setIcon( getIcon( ) );
group.setBadgeText( String.valueOf( group.getActions( ).size( ) ) );
group.setBadgeColor( strBadgeColor );
return group;
}
} |
File |
Line |
fr/paris/lutece/plugins/gru/web/actions/groups/builders/impl/ClaimActionGroupBuilder.java |
48 |
fr/paris/lutece/plugins/gru/web/actions/groups/builders/impl/InformationRequestActionGroupBuilder.java |
48 |
public class ClaimActionGroupBuilder extends AbstractDemandActionGroupBuilder
{
/**
* {@inheritDoc }
*/
@Override
public ActionGroup buildActionGroup( Customer customer, AdminUser user )
{
ActionGroup group = new ActionGroup( );
List<Demand> listDemands = DemandService.getDemandsIncludingTypes( customer, getIncludedTypesList( ), user );
String strBadgeColor = null;
for ( Demand demand : listDemands )
{
if ( demand.getStatusId( ) != Demand.STATUS_CLOSED )
{
ActionItem item = new ActionItem( );
item.setTitle( demand.getTitle( ) + " " + demand.getReference( ) );
item.setLink( buildDemandManagementLink( demand.getId( ), demand.getTypeId( ), customer.getId( ) ) );
item.setColor( processItemColor( demand, COLOR_DANGER ) ); |
File |
Line |
fr/paris/lutece/plugins/gru/web/AbstractManageDemandJspBean.java |
83 |
fr/paris/lutece/plugins/gru/web/domain/AbstractManageDomainGruJspBean.java |
86 |
String _strCurrentPageIndex = Paginator.getPageIndex( request, Paginator.PARAMETER_PAGE_INDEX, "1" );
_nDefaultItemsPerPage = AppPropertiesService.getPropertyInt( PROPERTY_DEFAULT_LIST_ITEM_PER_PAGE, 50 );
_nItemsPerPage = Paginator.getItemsPerPage( request, Paginator.PARAMETER_ITEMS_PER_PAGE, _nItemsPerPage, _nDefaultItemsPerPage );
UrlItem url = new UrlItem( strManageJsp );
String strUrl = url.getUrl( );
// PAGINATOR
@SuppressWarnings( "unchecked" )
LocalizedPaginator paginator = new LocalizedPaginator( list, _nItemsPerPage, strUrl, PARAMETER_PAGE_INDEX, _strCurrentPageIndex, getLocale( ) );
Map<String, Object> model = getModel( );
model.put( MARK_NB_ITEMS_PER_PAGE, String.valueOf( _nItemsPerPage ) );
model.put( MARK_PAGINATOR, paginator );
model.put( strBookmark, paginator.getPageItems( ) );
return model;
}
} |
File |
Line |
fr/paris/lutece/plugins/gru/business/feature/FeatureDAO.java |
90 |
fr/paris/lutece/plugins/gru/business/feature/FeatureDAO.java |
156 |
feature.setId( newPrimaryKey( plugin ) );
int nIndex = 1;
daoUtil.setInt( nIndex++, feature.getId( ) );
daoUtil.setString( nIndex++, feature.getName( ) );
daoUtil.setString( nIndex++, feature.getLink( ) );
daoUtil.setString( nIndex++, feature.getLinkCustomerParams( ) );
daoUtil.setInt( nIndex++, feature.getTarget( ) );
daoUtil.setInt( nIndex++, feature.getIdCategory( ) );
daoUtil.setInt( nIndex++, feature.getIdOrder( ) );
daoUtil.setInt( nIndex++, feature.getDisplayLevel( ) );
daoUtil.executeUpdate( ); |
File |
Line |
fr/paris/lutece/plugins/gru/web/AbstractManageAdminGRUJspBean.java |
63 |
fr/paris/lutece/plugins/gru/web/domain/AbstractManageDomainGruJspBean.java |
66 |
private int _nDefaultItemsPerPage;
private String _strCurrentPageIndex;
private int _nItemsPerPage;
/**
* Return a model that contains the list and paginator infos
*
* @param request
* The HTTP request
* @param strBookmark
* The bookmark
* @param list
* The list of item
* @param strManageJsp
* The JSP
* @return The model
*/
@SuppressWarnings( "rawtypes" )
protected Map<String, Object> getPaginatedListModel( HttpServletRequest request, String strBookmark, List list, String strManageJsp )
{
_strCurrentPageIndex = Paginator.getPageIndex( request, Paginator.PARAMETER_PAGE_INDEX, _strCurrentPageIndex );
_nDefaultItemsPerPage = AppPropertiesService.getPropertyInt( PROPERTY_DEFAULT_LIST_ITEM_PER_PAGE, 50 );
_nItemsPerPage = Paginator.getItemsPerPage( request, Paginator.PARAMETER_ITEMS_PER_PAGE, _nItemsPerPage, _nDefaultItemsPerPage );
UrlItem url = new UrlItem( strManageJsp );
String strUrl = url.getUrl( );
// PAGINATOR
@SuppressWarnings( "unchecked" )
LocalizedPaginator paginator = new LocalizedPaginator( list, _nItemsPerPage, strUrl, Constants.PARAMETER_PAGE_INDEX, _strCurrentPageIndex, getLocale( ) ); |
File |
Line |
fr/paris/lutece/plugins/gru/web/CustomerJspBean.java |
248 |
fr/paris/lutece/plugins/gru/web/CustomerJspBean.java |
310 |
public String getViewCustomerDemands( HttpServletRequest request ) throws AccessDeniedException
{
Customer customer = findCustomerFrom( request );
List<ActionPanel> listPanels = CustomerActionsService.getPanels( customer, getUser( ) );
List<NotifiedDemand> listInProgressDemands = DemandService.getNotifiedDemands( customer, getUser( ), Demand.STATUS_INPROGRESS );
int nInProgressDemandCount = listInProgressDemands.size( );
List<NotifiedDemand> listClosedDemands = DemandService.getNotifiedDemands( customer, getUser( ), Demand.STATUS_CLOSED );
int nClosedDemandCount = listClosedDemands.size( );
UrlItem url = new UrlItem( getControllerPath( ) + getControllerJsp( ) );
url.addParameter( Constants.PARAMETER_VIEW, VIEW_CUSTOMER_DEMANDS ); |
File |
Line |
fr/paris/lutece/plugins/gru/business/feature/FeatureDAO.java |
120 |
fr/paris/lutece/plugins/gru/business/feature/FeatureDAO.java |
219 |
feature = new Feature( );
int nIndex = 1;
feature.setId( daoUtil.getInt( nIndex++ ) );
feature.setName( daoUtil.getString( nIndex++ ) );
feature.setLink( daoUtil.getString( nIndex++ ) );
feature.setLinkCustomerParams( daoUtil.getString( nIndex++ ) );
feature.setTarget( daoUtil.getInt( nIndex++ ) );
feature.setIdCategory( daoUtil.getInt( nIndex++ ) );
feature.setIdOrder( daoUtil.getInt( nIndex++ ) );
feature.setDisplayLevel( daoUtil.getInt( nIndex++ ) ); |
File |
Line |
fr/paris/lutece/plugins/gru/business/feature/FeatureDAO.java |
180 |
fr/paris/lutece/plugins/gru/business/feature/FeatureDAO.java |
214 |
DAOUtil daoUtil = new DAOUtil( SQL_QUERY_SELECTALL, plugin );
daoUtil.executeQuery( );
while ( daoUtil.next( ) )
{
Feature feature = new Feature( );
int nIndex = 1;
feature.setId( daoUtil.getInt( nIndex++ ) );
feature.setName( daoUtil.getString( nIndex++ ) );
feature.setLink( daoUtil.getString( nIndex++ ) );
feature.setLinkCustomerParams( daoUtil.getString( nIndex++ ) );
feature.setTarget( daoUtil.getInt( nIndex++ ) );
feature.setIdCategory( daoUtil.getInt( nIndex++ ) );
feature.setCategory( daoUtil.getString( nIndex++ ) ); |