GithubHelp home page GithubHelp logo

eppendorf-sw / sbt-cpd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sbt/sbt-cpd

0.0 1.0 0.0 131 KB

Copy & Paste Detector plugin using PMD for sbt.

License: Eclipse Public License 1.0

Scala 100.00%

sbt-cpd's Introduction

sbt-cpd - Copy & Paste Detection using PMD/CPD for sbt

Build Status Codacy Grade sbt 0.13 version sbt 1.0 version pmd version

This is an sbt plugin for duplicate code detection using Copy/Paste Detector (CPD) from the PMD project.

Install the plugin by adding the following to project/plugins.sbt:

addSbtPlugin("com.github.sbt" % "sbt-cpd" % "<version>")

And then execute the plugin with sbt cpd. This will scan your source code under src/main/scala and output a report containing the duplicates to target/scala-2.xx/cpd/cpd.xml.

Settings

(see also the CPD documentation)

Key Type Default Description
cpdReportType CpdReportType CpdReportType.XML Selects the output format for the CPD report. Valid types: XML, Simple, CSV & VS
cpdLanguage CpdLanguage CpdLanguage.Scala Language to analyze.1
cpdMaxMemoryInMB Integer 512 Maximum amount of memory to allow for CPD (in MB).
cpdMinimumTokens Integer 100 Minimum number of tokens of potential duplicates.
cpdSourceEncoding String utf-8 Source file encoding.
cpdSourceDirectories Seq (Paths) main source path(s) Paths of the source files to analyze.
cpdOutputType CpdOutputType CpdOutputType.File Selects the output type for the CPD report.2 Valid types: File, Console
cpdTargetPath File Path <cross-target>/cpd Output path for CPD reports.
cpdReportName String (filename) cpd.xml Name of the report file to generate (under cpdTargetPath).
cpdReportFileEncoding String utf-8 Report file encoding.
cpdSkipDuplicateFiles Boolean false Ignore multiple copies of files of the same name and length in comparison.
cpdSkipLexicalErrors Boolean false Skip files which can't be tokenized due to invalid characters instead of aborting.
cpdIgnoreLiterals Boolean false Ignore literal value differences when evaluating a duplicate block.
cpdIgnoreIdentifiers Boolean false Ignore identifier name differences when evaluating a duplicate block.
cpdIgnoreAnnotations Boolean false Ignore language annotations when evaluating a duplicate block.
cpdFailOnDuplicates Boolean false Fail the build if duplicates are detected.
  1. Valid languages:
    • Scala
    • Java
    • C
    • CPP
    • CS
    • CSharp
    • ECMAScript
    • Fortran
    • Go
    • JSP
    • JavaScript
    • Matlab
    • ObjectiveC
    • PHP
    • PLSQ
    • Ruby
    • Swift
  2. If set to CpdOutputType.Console then cpdTargetPath and cpdReportName are ignored.

Contributors

Many thanks to

for their awesome contributions!

License

This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.