Skip to content

[core] Force disable suppressions (PMD + CPD) #2896

@kloessst

Description

@kloessst

Description:
Hello,

PMD itself has the option -showsuppressed, to disable suppressions added to the code (via SupressWarnings or comment filtering). Does something similar exist for CPD? I would appreciate such a feature and would gladly contribute, if it doesn't exist yet.

Edit:
It seems like PMD uses this option to create another section in the report:

// suppressed violations
            if (showSuppressedViolations) {
                for (Report.SuppressedViolation s : suppressed) {
                    writeNewLine();
                    xmlWriter.writeStartElement("suppressedviolation");
                    xmlWriter.writeAttribute("filename", determineFileName(s.getRuleViolation().getFilename()));
                    xmlWriter.writeAttribute("suppressiontype", s.suppressedByNOPMD() ? "nopmd" : "annotation");
                    xmlWriter.writeAttribute("msg", s.getRuleViolation().getDescription());
                    xmlWriter.writeAttribute("usermsg", s.getUserMessage() == null ? "" : s.getUserMessage());
                    xmlWriter.writeEndElement();
                }
            }

Is it be possible to add an option which disables all suppressions completely?

Best regards,
Stefan

Metadata

Metadata

Assignees

No one assigned

    Labels

    an:enhancementAn improvement on existing features / rules

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions