CPD Results

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

Duplications

File Line
org/itracker/web/forms/AdminActionForm.java 32
org/itracker/web/forms/ImportForm.java 32
public class AdminActionForm extends ValidatorForm {
    /**
     *
     */
    private static final long serialVersionUID = 1L;
    private transient org.apache.struts.upload.FormFile importFile;
    private Boolean optionreuseusers;
    private Boolean optionreuseprojects;
    private Boolean optionreuseconfig;
    private Boolean optionreusefields;
    private Boolean optioncreatepasswords;

    public void reset(ActionMapping mapping, HttpServletRequest request) {
        importFile = null;
        optionreuseusers = null;
        optionreuseprojects = null;
        optionreuseconfig = null;
        optionreusefields = null;
        optioncreatepasswords = null;

    }

    public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {
        ActionErrors errors = super.validate(mapping, request);

        return errors;
    }

    public org.apache.struts.upload.FormFile getImportFile() {
        return importFile;
    }

    public void setImportFile(org.apache.struts.upload.FormFile importFile) {
        this.importFile = importFile;
    }

    public Boolean getOptioncreatepasswords() {
        return optioncreatepasswords;
    }

    public void setOptioncreatepasswords(Boolean optioncreatepasswords) {
        this.optioncreatepasswords = optioncreatepasswords;
    }

    public Boolean getOptionreuseconfig() {
        return optionreuseconfig;
    }

    public void setOptionreuseconfig(Boolean optionreuseconfig) {
        this.optionreuseconfig = optionreuseconfig;
    }

    public Boolean getOptionreusefields() {
        return optionreusefields;
    }

    public void setOptionreusefields(Boolean optionreusefields) {
        this.optionreusefields = optionreusefields;
    }

    public Boolean getOptionreuseprojects() {
        return optionreuseprojects;
    }

    public void setOptionreuseprojects(Boolean optionreuseprojects) {
        this.optionreuseprojects = optionreuseprojects;
    }

    public Boolean getOptionreuseusers() {
        return optionreuseusers;
    }

    public void setOptionreuseusers(Boolean optionreuseusers) {
        this.optionreuseusers = optionreuseusers;
    }

}
File Line
org/itracker/web/actions/admin/user/EditUserFormAction.java 136
org/itracker/web/actions/admin/user/EditUserFormAction.java 155
                                if (permissionList.size() > 1 && i != 0) {

                                    Integer projectId = permissionList.get(i).getProject().getId();

                                    if (userPermissions.get(projectId) == null) {
                                        HashMap<String, Permission> projectPermissions = new HashMap<>();
                                        userPermissions.put(permissionList.get(i).getProject().getId(), projectPermissions);
                                    }

                                    formPermissions.put(permissionList.get(i).getPermissionType().name(permissionList.get(i).getProject()), true);

                                    PermissionType permissionType = permissionList.get(i).getPermissionType();

                                    Permission thisPermission = permissionList.get(i);
                                    HashMap<String, Permission> permissionHashMap = userPermissions.get(projectId);
                                    permissionHashMap.put(String.valueOf(permissionType), thisPermission);

                                }

                            } else {
File Line
org/itracker/web/actions/admin/configuration/EditConfigurationFormAction.java 91
org/itracker/web/actions/admin/configuration/EditCustomFieldValueFormAction.java 158
            Map<String, List<String>> languages = configurationService
                    .getAvailableLanguages();
            Map<NameValuePair, List<NameValuePair>> languagesNameValuePair = new TreeMap<>(NameValuePair.KEY_COMPARATOR);
            for (Map.Entry<String, List<String>> entry : languages.entrySet()) {
                String language = entry.getKey();
                List<String> locales = entry.getValue();
                List<NameValuePair> localesNameValuePair = new ArrayList<>();
                for (String locale : locales) {
                    NameValuePair localeNameValuePair = new NameValuePair(
                            locale, ITrackerResources.getString(
                            "itracker.locale.name", locale));
                    localesNameValuePair.add(localeNameValuePair);
                }
                NameValuePair languageNameValuePair = new NameValuePair(
                        language, ITrackerResources.getString(
                        "itracker.locale.name", language));
                languagesNameValuePair.put(languageNameValuePair,
                        localesNameValuePair);
            }
File Line
org/itracker/web/taglib/FormatIconActionTag.java 53
org/itracker/web/taglib/FormatImageActionTag.java 49
   private String info = null;
   private String caller = null;
   private String targetAction = null;
   private String target = null;

   public String getAction() {
      return action;
   }

   public void setAction(String value) {
      action = value;
   }

   public String getForward() {
      return forward;
   }

   public void setForward(String value) {
      forward = value;
   }

   public String getModule() {
      return module;
   }

   public void setModule(String module) {
      this.module = module;
   }

   public String getParamName() {
      return paramName;
   }

   public void setParamName(String value) {
      paramName = value;
   }

   public Object getParamValue() {
      return paramValue;
   }

   public void setParamValue(Object value) {
      paramValue = (value != null ? value.toString() : null);
   }

   public String getIcon() {
File Line
org/itracker/web/actions/admin/report/DownloadReportAction.java 53
org/itracker/web/actions/admin/report/ExportReportAction.java 48
        try {
            Integer reportId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id")));
            if (reportId == null || reportId.intValue() < 0) {
                errors.add(ActionMessages.GLOBAL_MESSAGE, new ActionMessage("itracker.web.error.invalidreport"));
            } else {
                ReportService reportService = ServletContextUtils.getItrackerServices().getReportService();

                Report report = reportService.getReportDAO().findByPrimaryKey(reportId);
                if (report != null) {
                    response.setContentType("application/x-itracker-report-export");
                    response.setHeader("Content-Disposition", "attachment; filename=\"ITracker_report_" + report.getId() + ".def\"");
File Line
org/itracker/web/actions/admin/configuration/RemoveConfigurationItemAction.java 79
org/itracker/web/actions/admin/configuration/RemoveConfigurationItemAction.java 123
                    List<Configuration> configItems = configurationService.getConfigurationItemsByType(Configuration.Type.severity);
                    for (int i = 0; i < configItems.size(); i++) {
                        if (configItems.get(i) != null && configId.equals(configItems.get(i).getId())) {
                            if (i == 0 && (i + 1) < configItems.size()) {
                                newConfigValue = configItems.get(i + 1).getValue();
                                break;
                            } else if (i > 0) {
                                newConfigValue = configItems.get(i - 1).getValue();
                                break;
                            }
                        }
                    }

                    int currSeverity = Integer.parseInt(currConfigValue);
File Line
org/itracker/web/actions/admin/project/EditComponentFormAction.java 45
org/itracker/web/actions/admin/project/EditVersionFormAction.java 44
    private static final Logger log = Logger.getLogger(EditComponentFormAction.class);


    @SuppressWarnings("unchecked")
    public ActionForward execute(ActionMapping mapping,
                                 ActionForm form,
                                 HttpServletRequest request,
                                 HttpServletResponse response)
            throws ServletException, IOException {
        ActionMessages errors = new ActionMessages();

        String pageTitleKey = "";
        String pageTitleArg = "";


        try {
            ProjectService projectService = ServletContextUtils.getItrackerServices().getProjectService();

            HttpSession session = request.getSession(true);
            String action = request.getParameter("action");
            Map<Integer, Set<PermissionType>> userPermissions = (Map<Integer, Set<PermissionType>>) session.getAttribute(Constants.PERMISSIONS_KEY);
File Line
org/itracker/web/forms/ComponentForm.java 48
org/itracker/web/forms/VersionForm.java 48
        name = null;
        description = null;
        status = 0;
    }

    public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {
        ActionErrors errors = super.validate(mapping, request);

        return errors;
    }

    public String getAction() {
        return action;
    }

    public void setAction(String action) {
        this.action = action;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
File Line
org/itracker/web/actions/admin/configuration/RemoveCustomFieldAction.java 43
org/itracker/web/actions/admin/configuration/RemoveCustomFieldValueAction.java 46
    private static final Logger log = Logger.getLogger(RemoveCustomFieldAction.class);


    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        ActionMessages errors = new ActionMessages();


        if (!LoginUtilities.hasPermission(UserUtilities.PERMISSION_USER_ADMIN, request, response)) {
            return mapping.findForward("unauthorized");
        }

        try {
            ConfigurationService configurationService = ServletContextUtils.getItrackerServices().getConfigurationService();

            Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id");
            if (valueId == null || valueId.intValue() <= 0) {
                throw new SystemConfigurationException("Invalid custom field id.");

R.Ø.S.A.