Sider Documentation

Sider Documentation

  • Enterprise
  • News
  • Sider Top

›Others

Getting Started

  • Home
  • Intro Videos
  • Setting up Sider
  • Dashboard Overview
  • Repository Settings
  • Custom Analysis Configuration
  • Recommended Ruleset
  • Working with Issues
  • Permissions
  • Skip Analyzing

Analysis Tools

    Ruby

    • RuboCop
    • Reek
    • Querly
    • Rails Best Practices
    • Brakeman
    • HAML-Lint
    • Slim-Lint (beta)

    Java

    • Checkstyle
    • PMD
    • JavaSee

    Kotlin

    • ktlint (beta)
    • detekt (beta)

    JavaScript and Flavors

    • ESLint
    • JSHint
    • TyScan
    • CoffeeLint
    • TSLint (deprecated)

    CSS

    • stylelint
    • SCSS-Lint (deprecated)

    PHP

    • PHP_CodeSniffer
    • PHPMD
    • Phinder

    Python

    • Flake8
    • Pylint (beta)

    Swift

    • SwiftLint

    Go

    • GolangCI-Lint

    C/C++

    • Cppcheck
    • cpplint
    • Clang-Tidy (beta)

    C#

    • FxCop (beta)

    Shell script

    • ShellCheck

    Dockerfile

    • hadolint

    Markdown

    • remark-lint

    Others

    • Goodcheck
    • Misspell
    • LanguageTool (beta)
    • PMD CPD (beta)

Custom Rules

  • Intro to Custom Rules
  • Goodcheck
  • Tips & Tricks

Advanced Settings

  • Inline Comments
  • Private Dependencies
  • Restricting access to Close button
  • Transferring a repository

Billing and Plans

  • Billing and Plans

Troubleshooting

  • Troubleshooting

Enterprise

  • Outline
  • System Overview
  • Installation
  • Configuration
  • Operation
  • Update
  • Load Balancer
  • MySQL
  • Redis
  • MinIO
  • Amazon S3
  • GitHub Enterprise Server
  • Clustering
  • Example Deployments

    • Single Node with Docker Compose

    Releases

    • Overview
    • February 2021
    • January 2021
    • December 2020
    • October 2020
    • September 2020
    • August 2020
    • July 2020
    • June 2020
    • May 2020
    • April 2020
    • February 2020
    • January 2020
    • November 2019
    • Older releases

News

  • 2021
  • 2020
  • 2019
Edit

PMD CPD

This is BETA. The behavior of this tool might change.

Supported VersionLanguageWebsite
6.32.0Programming languageshttps://pmd.github.io

PMD CPD is the copy-paste detector shipped with PMD. CPD works with Java, JSP, C/C++, C#, Go, Kotlin, Ruby, Swift and many more languages.

Getting Started

To start using PMD CPD, enable it in your repository settings.

Configuration

You can customize the analysis via sider.yml:

linter:
  pmd_cpd:
    minimum-tokens: 70
    files: src
    language: cpp
    encoding: UTF-8
    skip-duplicate-files: true
    non-recursive: true
    skip-lexical-errors: true
    ignore-annotations: true
    ignore-identifiers: true
    ignore-literals: true
    ignore-usings: true
    no-skip-blocks: true
    skip-blocks-pattern: "#ifdef TEST|#endif"
NameTypeDefault
root_dirstring-
minimum-tokensnumber100
filesstring, string[].
languagestring, string[](See below)
encodingstring(PMD's default)
skip-duplicate-filesbooleanfalse
non-recursivebooleanfalse
skip-lexical-errorsbooleanfalse
ignore-annotationsbooleanfalse
ignore-identifiersbooleanfalse
ignore-literalsbooleanfalse
ignore-usingsbooleanfalse
no-skip-blocksbooleanfalse
skip-blocks-patternstring(PMD's default)

minimum-tokens

The minimum token length which should be reported as a duplicate.

files

This option allows you to specify a list of files and directories to analyze, e.g.:

linter:
  pmd_cpd:
    files: src
    # or
    # files: [src, lib]
    # or
    # files: [path/to/Some.java, src]

language

This option allows you to specify one or more languages you want to analyze, e.g.:

linter:
  pmd_cpd:
    language: cpp
    # or
    # language: [cpp, java, python]

Here are available:

  • apex
  • cpp *
  • cs *
  • dart
  • ecmascript *
  • fortran
  • go *
  • groovy
  • java *
  • jsp
  • kotlin *
  • lua
  • matlab
  • modelica
  • objectivec
  • perl
  • php *
  • plsql
  • python *
  • ruby *
  • scala
  • swift *
  • vf
  • xml

The default languages marked with * are used if you omit the option.

See also the PMD CPD document.

encoding

This option allows you to specify an encoding of your source code.

skip-duplicate-files

This option allows you to ignore multiple copies of files of the same name and length in comparison.

non-recursive

If you do not want to analyze the sub-directories, set this option to true.

skip-lexical-errors

If you want to skip files which cannot be tokenized due to invalid characters, set this option to true.

ignore-annotations

(Java only) If you want to ignore annotations on classes and methods, set this option to true.

ignore-identifiers

(Java only) If you want to ignore constant and variable names, set this option to true.

ignore-literals

(Java only) If you want to ignore number values and string contents, set this option to true.

ignore-usings

(C# only) If you want to ignore using directives, set this option to true.

no-skip-blocks

(C/C++ only) If you do not want to skip code blocks matched by the skip-blocks-pattern option, set this option to true.

skip-blocks-pattern

(C/C++ only) You can configure the pattern, to find the blocks to skip:

linter:
  pmd_cpd:
    language: c
    skip-blocks-pattern: "#ifdef TEST|#endif"

This option value consists of two parts, separated by |. The first part is the start pattern, the second part is the ending pattern.

← LanguageTool (beta)Intro to Custom Rules →
  • Getting Started
  • Configuration
    • minimum-tokens
    • files
    • language
    • encoding
    • skip-duplicate-files
    • non-recursive
    • skip-lexical-errors
    • ignore-annotations
    • ignore-identifiers
    • ignore-literals
    • ignore-usings
    • no-skip-blocks
    • skip-blocks-pattern
Sider Documentation
Docs
Getting StartedAnalysis ToolsEnterprise
Sider
Sider TopTerms of ServicePrivacy
Social
BlogGitHubStar
Copyright © 2021 Sider, Inc.