Fork me on GitHub

Résultats CPD

Le document suivant contient les résultats de l'inspection CPD CPD 5.3.5.

Duplicatas

Fichier Ligne
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 458
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 506
    public String getModifyRuleEntry( HttpServletRequest request )
    {
        if ( !RBACService.isAuthorized( Rule.RESOURCE_TYPE, RBAC.WILDCARD_RESOURCES_ID,
                    DateValidatorsResourceIdService.PERMISSION_RULE_MODIFY, getUser(  ) ) )
        {
            return getManageValidator( request );
        }

        Integer nIdRule = DateValidatorsUtils.stringToInt( request.getParameter( PARAMETER_ID_RULE ) );

        if ( nIdRule == null )
        {
            return getManageValidator( request );
        }

        Rule rule = RuleHome.findByPrimaryKey( nIdRule, PLUGIN );

        if ( rule == null )
        {
            return getManageValidator( request );
        }

        setPageTitleProperty( PROPERTY_MODIFY_RULE_TITLE );

        ReferenceList refListComparator = ComparatorHome.findAll( PLUGIN );
        ReferenceItem refItem = new ReferenceItem(  );
        refItem.setCode( String.valueOf( -1 ) );
        refItem.setName( DateValidatorsConstants.EMPTY_STRING );
        refListComparator.add( 0, refItem );

        Map<String, Object> model = new HashMap<String, Object>(  );
        model.put( MARK_RULE, rule );
        model.put( DateValidatorsConstants.MARK_ENTRY_LIST,
            DateValidatorsService.getAuthorizedEntries( rule.getIdForm(  ) ) );
        model.put( DateValidatorsConstants.MARK_COMPARATOR_LIST, refListComparator );
        model.put( MARK_TYPE, DateValidatorsConstants.TYPE_ENTRY );
Fichier Ligne
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 458
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 506
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 556
    public String getModifyRuleEntry( HttpServletRequest request )
    {
        if ( !RBACService.isAuthorized( Rule.RESOURCE_TYPE, RBAC.WILDCARD_RESOURCES_ID,
                    DateValidatorsResourceIdService.PERMISSION_RULE_MODIFY, getUser(  ) ) )
        {
            return getManageValidator( request );
        }

        Integer nIdRule = DateValidatorsUtils.stringToInt( request.getParameter( PARAMETER_ID_RULE ) );

        if ( nIdRule == null )
        {
            return getManageValidator( request );
        }

        Rule rule = RuleHome.findByPrimaryKey( nIdRule, PLUGIN );

        if ( rule == null )
        {
            return getManageValidator( request );
        }

        setPageTitleProperty( PROPERTY_MODIFY_RULE_TITLE );

        ReferenceList refListComparator = ComparatorHome.findAll( PLUGIN );
        ReferenceItem refItem = new ReferenceItem(  );
        refItem.setCode( String.valueOf( -1 ) );
        refItem.setName( DateValidatorsConstants.EMPTY_STRING );
        refListComparator.add( 0, refItem );

        Map<String, Object> model = new HashMap<String, Object>(  );
        model.put( MARK_RULE, rule );
        model.put( DateValidatorsConstants.MARK_ENTRY_LIST,
            DateValidatorsService.getAuthorizedEntries( rule.getIdForm(  ) ) );
        model.put( DateValidatorsConstants.MARK_COMPARATOR_LIST, refListComparator );
        model.put( MARK_TYPE, DateValidatorsConstants.TYPE_ENTRY );
Fichier Ligne
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 282
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 323
    public String getCreateRuleEntry( HttpServletRequest request )
    {
        if ( !RBACService.isAuthorized( Rule.RESOURCE_TYPE, RBAC.WILDCARD_RESOURCES_ID,
                    DateValidatorsResourceIdService.PERMISSION_RULE_CREATE, getUser(  ) ) )
        {
            return getManageValidator( request );
        }

        Integer nIdForm = DateValidatorsUtils.stringToInt( request.getParameter( 
                    DateValidatorsConstants.PARAMETER_ID_FORM ) );

        if ( nIdForm == null )
        {
            return getManageValidator( request );
        }

        setPageTitleProperty( PROPERTY_CREATE_RULE_TITLE );

        ReferenceList refListComparator = ComparatorHome.findAll( PLUGIN );
        ReferenceItem refItem = new ReferenceItem(  );
        refItem.setCode( String.valueOf( -1 ) );
        refItem.setName( DateValidatorsConstants.EMPTY_STRING );
        refListComparator.add( 0, refItem );

        Map<String, Object> model = new HashMap<String, Object>(  );
        model.put( DateValidatorsConstants.MARK_ID_FORM, nIdForm );
        model.put( DateValidatorsConstants.MARK_ENTRY_LIST, DateValidatorsService.getAuthorizedEntries( nIdForm ) );
        model.put( DateValidatorsConstants.MARK_COMPARATOR_LIST, refListComparator );
        model.put( MARK_TYPE, DateValidatorsConstants.TYPE_ENTRY );
Fichier Ligne
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 282
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 323
fr/paris/lutece/plugins/form/modules/datevalidators/web/DateValidatorsJspBean.java 366
    public String getCreateRuleEntry( HttpServletRequest request )
    {
        if ( !RBACService.isAuthorized( Rule.RESOURCE_TYPE, RBAC.WILDCARD_RESOURCES_ID,
                    DateValidatorsResourceIdService.PERMISSION_RULE_CREATE, getUser(  ) ) )
        {
            return getManageValidator( request );
        }

        Integer nIdForm = DateValidatorsUtils.stringToInt( request.getParameter( 
                    DateValidatorsConstants.PARAMETER_ID_FORM ) );

        if ( nIdForm == null )
        {
            return getManageValidator( request );
        }

        setPageTitleProperty( PROPERTY_CREATE_RULE_TITLE );

        ReferenceList refListComparator = ComparatorHome.findAll( PLUGIN );
        ReferenceItem refItem = new ReferenceItem(  );
        refItem.setCode( String.valueOf( -1 ) );
        refItem.setName( DateValidatorsConstants.EMPTY_STRING );
        refListComparator.add( 0, refItem );

        Map<String, Object> model = new HashMap<String, Object>(  );
        model.put( DateValidatorsConstants.MARK_ID_FORM, nIdForm );
        model.put( DateValidatorsConstants.MARK_ENTRY_LIST, DateValidatorsService.getAuthorizedEntries( nIdForm ) );
        model.put( DateValidatorsConstants.MARK_COMPARATOR_LIST, refListComparator );
        model.put( MARK_TYPE, DateValidatorsConstants.TYPE_ENTRY );
Fichier Ligne
fr/paris/lutece/plugins/form/modules/datevalidators/business/RuleDAO.java 102
fr/paris/lutece/plugins/form/modules/datevalidators/business/RuleDAO.java 147
        daoUtil.setInt( nIndex++, rule.getIdEntry1(  ) );
        daoUtil.setInt( nIndex++, rule.getIdComparator(  ) );

        if ( rule.getIdEntry2(  ) != null )
        {
            daoUtil.setInt( nIndex++, rule.getIdEntry2(  ) );
        }
        else
        {
            daoUtil.setIntNull( nIndex++ );
        }

        if ( rule.getDateReference(  ) != null )
        {
            daoUtil.setDate( nIndex++, new Date( rule.getDateReference(  ).getTime(  ) ) );
        }
        else
        {
            daoUtil.setDate( nIndex++, null );
        }

        if ( ( rule.getDateCalculated(  ) != null ) && ( rule.getDateCalculated(  ).getIdDateCalculated(  ) > 0 ) )
        {
            daoUtil.setInt( nIndex++, rule.getDateCalculated(  ).getIdDateCalculated(  ) );
        }
        else
        {
            daoUtil.setIntNull( nIndex++ );
        }

        daoUtil.executeUpdate(  );