pmdtester 1.0.0.pre.beta2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rubocop.yml +10 -0
- data/.rubocop_todo.yml +27 -0
- data/.travis.yml +22 -0
- data/Gemfile +20 -0
- data/History.md +36 -0
- data/LICENSE +25 -0
- data/README.rdoc +33 -0
- data/Rakefile +54 -0
- data/bin/pmdtester +7 -0
- data/config/all-java.xml +18 -0
- data/config/design.xml +78 -0
- data/config/project-list.xml +29 -0
- data/config/projectlist_1_0_0.xsd +28 -0
- data/lib/pmdtester/builders/diff_builder.rb +35 -0
- data/lib/pmdtester/builders/diff_report_builder.rb +226 -0
- data/lib/pmdtester/builders/html_report_builder.rb +34 -0
- data/lib/pmdtester/builders/pmd_report_builder.rb +128 -0
- data/lib/pmdtester/builders/rule_set_builder.rb +114 -0
- data/lib/pmdtester/builders/summary_report_builder.rb +149 -0
- data/lib/pmdtester/cmd.rb +40 -0
- data/lib/pmdtester/parsers/options.rb +147 -0
- data/lib/pmdtester/parsers/pmd_report_document.rb +82 -0
- data/lib/pmdtester/parsers/projects_parser.rb +41 -0
- data/lib/pmdtester/pmd_branch_detail.rb +67 -0
- data/lib/pmdtester/pmd_error.rb +67 -0
- data/lib/pmdtester/pmd_report_detail.rb +47 -0
- data/lib/pmdtester/pmd_violation.rb +66 -0
- data/lib/pmdtester/pmdtester.rb +17 -0
- data/lib/pmdtester/project.rb +112 -0
- data/lib/pmdtester/report_diff.rb +111 -0
- data/lib/pmdtester/resource_locator.rb +10 -0
- data/lib/pmdtester/runner.rb +130 -0
- data/resources/css/maven-base.css +155 -0
- data/resources/css/maven-theme.css +171 -0
- metadata +249 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bc98cf9ced82209cfacc2752160229c5eb067c9604c8639d3ec5d9663134d8fc
|
4
|
+
data.tar.gz: 2c5a013fe96a5e60614f7d932837434a42e15ba19ae5a5e7096934ae4b7692f7
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: eb72595523c73e2a2a9adfe560f653baf0c35581ee803d3381ef9f400c90aeec9f92ef262f19f6f56323a848a5b4a98fb898af811577c815429a6ac93c619e7e
|
7
|
+
data.tar.gz: 93d11d0f0943378987968434a6f0a36391830826a70dc6a8ce09a9706aef6cd5cfe87bf31671e7bba031ac52f34c2d26e4edc96f096a5c02f9be19dfd2ce4a82
|
data/.rubocop.yml
ADDED
data/.rubocop_todo.yml
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
# This configuration was generated by
|
2
|
+
# `rubocop --auto-gen-config`
|
3
|
+
# on 2018-07-12 16:57:46 +0800 using RuboCop version 0.56.0.
|
4
|
+
# The point is for the user to remove these configuration records
|
5
|
+
# one by one as the offenses are removed from the code base.
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
8
|
+
|
9
|
+
# Offense count: 22
|
10
|
+
Metrics/AbcSize:
|
11
|
+
Max: 47
|
12
|
+
|
13
|
+
# Offense count: 3
|
14
|
+
# Configuration parameters: CountComments.
|
15
|
+
Metrics/ClassLength:
|
16
|
+
Max: 174
|
17
|
+
|
18
|
+
# Offense count: 33
|
19
|
+
# Configuration parameters: CountComments.
|
20
|
+
Metrics/MethodLength:
|
21
|
+
Max: 35
|
22
|
+
|
23
|
+
# Offense count: 5
|
24
|
+
Naming/AccessorMethodName:
|
25
|
+
Exclude:
|
26
|
+
- 'lib/pmdtester/builders/pmd_report_builder.rb'
|
27
|
+
- 'lib/pmdtester/parsers/projects_parser.rb'
|
data/.travis.yml
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
language: ruby
|
2
|
+
jdk: oraclejdk9
|
3
|
+
script:
|
4
|
+
- rake rubocop
|
5
|
+
- rake clean test
|
6
|
+
- rake clean integration-test
|
7
|
+
- rake install_gem
|
8
|
+
- pmdtester -h
|
9
|
+
|
10
|
+
before_deploy:
|
11
|
+
- git stash --all
|
12
|
+
- rake hoe:spec
|
13
|
+
|
14
|
+
deploy:
|
15
|
+
provider: rubygems
|
16
|
+
api_key:
|
17
|
+
secure: xcEpX/r7es6/jnvNPrVClVkKLemC+4EaFACfK9PCw05jAqf3sDX8UMKD2B4NU1JfF+I/szC5loyCe8s1wBUbFhelR8sL93RNOyVlQCKqaDTFw0DUvnbKWdgDb7POhcmo8SWi4aaKPias6wCuWA/Wc6jUvcrlAgKDsmYqOukXQoFyQbOUsnqrE/FMA7BfUIHkeeJbNk8807u4+aMqahZyzTFvuEVBUvKqCzDYPl9kpm4fzOtjxiExj1ic9dr2Dz5bcyWteMjZFSgjYWgZUXpk8FWCj5R/8VQsklxFFXFZlQIVwqtpaKgEOjwOOxaA6b8O7OeU82HtSPfxy6eCNE7pvzoYq+ZGxxk6fPbAl2mqKtPU76oRKH8YmXuEdDtdHVCYp7wOFdrLhJ6bJ3H/DSD14Kso21D3ktt4y4qkCd0Ev1a6nbY3LrO+NqFlZytwlYY1t8CUWyc9GfvpQXd7j0shSvrh2RU0+ATcQc0tRSHE2htjbiMWPi/ffMNe5h7iVqho5cLC4n187VrWOqGJf2S47spIgw9N3VWzyfAxAxI2XIvWcGoAIQhEgU6bH14Mz+0amG6ggzCBAbDPEC1j8cuwVkmanWCWZWi6EuRbCYZ7rgCFIx3hZS9NPBANfcXudm7eINvuMlFnmwrVzmtTIEZTy56ZfaWPzGxotyn5M9DdT1U=
|
18
|
+
on:
|
19
|
+
tags: true
|
20
|
+
skip_cleanup: true
|
21
|
+
gem: pmdtester
|
22
|
+
gemspec: pmdtester.gemspec
|
data/Gemfile
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
# -*- ruby -*-
|
2
|
+
|
3
|
+
# DO NOT EDIT THIS FILE. Instead, edit Rakefile, and run `rake bundler:gemfile`.
|
4
|
+
|
5
|
+
source "https://rubygems.org/"
|
6
|
+
|
7
|
+
gem "nokogiri", "~>1.8.2"
|
8
|
+
gem "slop", "~>4.6.2"
|
9
|
+
|
10
|
+
gem "hoe-bundler", "~>1.2", :group => [:development, :test]
|
11
|
+
gem "hoe-gemspec", "~>1.0", :group => [:development, :test]
|
12
|
+
gem "hoe-git", "~>1.6", :group => [:development, :test]
|
13
|
+
gem "minitest", "~>5.10.1", :group => [:development, :test]
|
14
|
+
gem "mocha", "~>1.5.0", :group => [:development, :test]
|
15
|
+
gem "rubocop", "~>0.56.0", :group => [:development, :test]
|
16
|
+
gem "test-unit", "~>3.2.3", :group => [:development, :test]
|
17
|
+
gem "rdoc", ">=4.0", "<6", :group => [:development, :test]
|
18
|
+
gem "hoe", "~>3.17", :group => [:development, :test]
|
19
|
+
|
20
|
+
# vim: syntax=ruby
|
data/History.md
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# 1.0.0.beta2 / 2018-07-17
|
2
|
+
|
3
|
+
* First release of pmdtester
|
4
|
+
|
5
|
+
Note: This is a beta release. The pmdtester is feature complete,
|
6
|
+
but might contains bugs.
|
7
|
+
|
8
|
+
## External Contributions
|
9
|
+
|
10
|
+
* [#1](https://github.com/pmd/pmd-regression-tester/pull/1): Initialize project - [BBG](https://github.com/djydewang)
|
11
|
+
* [#2](https://github.com/pmd/pmd-regression-tester/pull/2): Add projects parser & design format of projectlist - [BBG](https://github.com/djydewang)
|
12
|
+
* [#3](https://github.com/pmd/pmd-regression-tester/pull/3): Add pmd report builder - [BBG](https://github.com/djydewang)
|
13
|
+
* [#4](https://github.com/pmd/pmd-regression-tester/pull/4): Test PmdReportBuilder - [BBG](https://github.com/djydewang)
|
14
|
+
* [#5](https://github.com/pmd/pmd-regression-tester/pull/5): Add DiffBuilder for PmdTester - [BBG](https://github.com/djydewang)
|
15
|
+
* [#6](https://github.com/pmd/pmd-regression-tester/pull/6): Change the package command for building PMD - [BBG](https://github.com/djydewang)
|
16
|
+
* [#7](https://github.com/pmd/pmd-regression-tester/pull/7): Add test cases for DiffBuilder - [BBG](https://github.com/djydewang)
|
17
|
+
* [#8](https://github.com/pmd/pmd-regression-tester/pull/8): Add HtmlReportBuilder to PmdTester - [BBG](https://github.com/djydewang)
|
18
|
+
* [#9](https://github.com/pmd/pmd-regression-tester/pull/9): Add test cases for HtmlReportBuilder - [BBG](https://github.com/djydewang)
|
19
|
+
* [#10](https://github.com/pmd/pmd-regression-tester/pull/10): Add bundler to manage dependency - [BBG](https://github.com/djydewang)
|
20
|
+
* [#11](https://github.com/pmd/pmd-regression-tester/pull/11): Using rubocop to check code style of the project - [BBG](https://github.com/djydewang)
|
21
|
+
* [#12](https://github.com/pmd/pmd-regression-tester/pull/12): Fix Metrics/BlockLength offenses - [BBG](https://github.com/djydewang)
|
22
|
+
* [#13](https://github.com/pmd/pmd-regression-tester/pull/13): Separate integration test cases - [BBG](https://github.com/djydewang)
|
23
|
+
* [#14](https://github.com/pmd/pmd-regression-tester/pull/14): Add Runner to PmdTester - [BBG](https://github.com/djydewang)
|
24
|
+
* [#15](https://github.com/pmd/pmd-regression-tester/pull/15): Fix rubocop Style/Documentation offenses - [BBG](https://github.com/djydewang)
|
25
|
+
* [#16](https://github.com/pmd/pmd-regression-tester/pull/16): Add single mode, add mocha library for unit test - [BBG](https://github.com/djydewang)
|
26
|
+
* [#17](https://github.com/pmd/pmd-regression-tester/pull/17): Add more details about pmd branchs and pmd reports - [BBG](https://github.com/djydewang)
|
27
|
+
* [#18](https://github.com/pmd/pmd-regression-tester/pull/18): Add SummaryReportBuilder to PmdTester - [BBG](https://github.com/djydewang)
|
28
|
+
* [#19](https://github.com/pmd/pmd-regression-tester/pull/19): Add online mode for PmdTester - [BBG](https://github.com/djydewang)
|
29
|
+
* [#20](https://github.com/pmd/pmd-regression-tester/pull/20): Change the way of parsing xml file from DOM to SAX - [BBG](https://github.com/djydewang)
|
30
|
+
* [#21](https://github.com/pmd/pmd-regression-tester/pull/21): Add auto-gen-config option for PmdTester - [BBG](https://github.com/djydewang)
|
31
|
+
* [#22](https://github.com/pmd/pmd-regression-tester/pull/22): Add 'introduce new errors' table head for html summary report - [BBG](https://github.com/djydewang)
|
32
|
+
* [#23](https://github.com/pmd/pmd-regression-tester/pull/23): Preparing for the release of PmdTester - [BBG](https://github.com/djydewang)
|
33
|
+
* [#24](https://github.com/pmd/pmd-regression-tester/pull/24): Adding a logging framework for PmdTester - [BBG](https://github.com/djydewang)
|
34
|
+
* [#25](https://github.com/pmd/pmd-regression-tester/pull/25): Remove working directory substring from filename of pmd violation - [BBG](https://github.com/djydewang)
|
35
|
+
* [#26](https://github.com/pmd/pmd-regression-tester/pull/26): Release pmdtester 1.0.0.beta1 - [BBG](https://github.com/djydewang)
|
36
|
+
* [#27](https://github.com/pmd/pmd-regression-tester/pull/27): Release pmdtester 1.0.0.beta2 - [BBG](https://github.com/djydewang)
|
data/LICENSE
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
BSD 2-Clause License
|
2
|
+
|
3
|
+
Copyright (c) 2018, PMD
|
4
|
+
All rights reserved.
|
5
|
+
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
8
|
+
|
9
|
+
* Redistributions of source code must retain the above copyright notice, this
|
10
|
+
list of conditions and the following disclaimer.
|
11
|
+
|
12
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
14
|
+
and/or other materials provided with the distribution.
|
15
|
+
|
16
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
17
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
18
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
19
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
20
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
21
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
22
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
23
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
24
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
25
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
= pmdtester
|
2
|
+
|
3
|
+
code :: https://github.com/pmd/pmd-regression-tester
|
4
|
+
bugs :: https://github.com/pmd/pmd-regression-tester/issues
|
5
|
+
|
6
|
+
build-status :: {<img src="https://travis-ci.com/pmd/pmd-regression-tester.svg?branch=master" alt="Build Status" />}[https://travis-ci.com/pmd/pmd-regression-tester]
|
7
|
+
|
8
|
+
== DESCRIPTION:
|
9
|
+
|
10
|
+
A regression testing tool ensure that new problems and unexpected behaviors will not be introduced to PMD project after fixing an issue , and new rules can work as expected.
|
11
|
+
|
12
|
+
== FEATURES/PROBLEMS:
|
13
|
+
|
14
|
+
The diff report can be generated according to the base and patch branch of PMD
|
15
|
+
on a list of standard projects(Spring Framework, Hibernate, Solr, etc.)
|
16
|
+
|
17
|
+
== SYNOPSIS:
|
18
|
+
|
19
|
+
* FIX (code sample of usage)
|
20
|
+
|
21
|
+
== REQUIREMENTS:
|
22
|
+
|
23
|
+
* FIX (list of requirements)
|
24
|
+
|
25
|
+
== INSTALL:
|
26
|
+
|
27
|
+
* FIX (sudo gem install, anything else)
|
28
|
+
|
29
|
+
== DEVELOPERS:
|
30
|
+
|
31
|
+
You can list all tasks by running `rake -T`.
|
32
|
+
|
33
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# -*- ruby -*-
|
4
|
+
require 'rake/testtask'
|
5
|
+
require 'rubocop/rake_task'
|
6
|
+
require_relative './lib/pmdtester/parsers/options.rb'
|
7
|
+
|
8
|
+
gem 'hoe'
|
9
|
+
require 'hoe'
|
10
|
+
Hoe.plugin :bundler
|
11
|
+
Hoe.plugin :gemspec
|
12
|
+
Hoe.plugin :git
|
13
|
+
|
14
|
+
hoe = Hoe.spec 'pmdtester' do
|
15
|
+
self.version = PmdTester::Options::VERSION
|
16
|
+
|
17
|
+
developer 'Andreas Dangel', 'andreas.dangel@adangel.org'
|
18
|
+
developer 'Binguo Bao', 'djydewang@gmail.com'
|
19
|
+
|
20
|
+
self.clean_globs = %w[target/reports/**/* target/test/**/*]
|
21
|
+
self.extra_deps += [['nokogiri', '~> 1.8.2'], ['slop', '~> 4.6.2']]
|
22
|
+
self.extra_dev_deps += [
|
23
|
+
['hoe-bundler', '~> 1.2'],
|
24
|
+
['hoe-gemspec', '~> 1.0'],
|
25
|
+
['hoe-git', '~> 1.6'],
|
26
|
+
['minitest', '~> 5.10.1'],
|
27
|
+
['mocha', '~> 1.5.0'],
|
28
|
+
['rubocop', '~> 0.56.0'],
|
29
|
+
['test-unit', '~> 3.2.3']
|
30
|
+
]
|
31
|
+
|
32
|
+
license 'BSD-2-Clause'
|
33
|
+
end
|
34
|
+
|
35
|
+
# Refers to
|
36
|
+
# http://rubocop.readthedocs.io/en/latest/integration_with_other_tools/#rake-integration
|
37
|
+
RuboCop::RakeTask.new(:rubocop) do |task|
|
38
|
+
task.patterns = %w[lib/**/*.rb test/**/*.rb]
|
39
|
+
end
|
40
|
+
|
41
|
+
# Run integration test cases
|
42
|
+
Rake::TestTask.new('integration-test') do |task|
|
43
|
+
task.description = 'Run integration test cases'
|
44
|
+
task.libs = ['test']
|
45
|
+
task.pattern = 'test/**/integration_test_*.rb'
|
46
|
+
task.verbose = true
|
47
|
+
end
|
48
|
+
|
49
|
+
desc 'generate the pmdtester.gemspec file'
|
50
|
+
task 'hoe:spec' do
|
51
|
+
File.open("#{hoe.name}.gemspec", "w") { |f| f.write hoe.spec.to_ruby}
|
52
|
+
end
|
53
|
+
|
54
|
+
# vim: syntax=ruby
|
data/bin/pmdtester
ADDED
data/config/all-java.xml
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
|
3
|
+
<ruleset name="All Java Rules"
|
4
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
5
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
6
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
|
7
|
+
<description>Every Java Rule in PMD</description>
|
8
|
+
|
9
|
+
<rule ref="category/java/bestpractices.xml" />
|
10
|
+
<rule ref="category/java/codestyle.xml" />
|
11
|
+
<rule ref="category/java/design.xml" />
|
12
|
+
<rule ref="category/java/documentation.xml" />
|
13
|
+
<rule ref="category/java/errorprone.xml" />
|
14
|
+
<rule ref="category/java/multithreading.xml" />
|
15
|
+
<rule ref="category/java/performance.xml" />
|
16
|
+
<rule ref="category/java/security.xml" />
|
17
|
+
|
18
|
+
</ruleset>
|
data/config/design.xml
ADDED
@@ -0,0 +1,78 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
|
3
|
+
<ruleset name="Design"
|
4
|
+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
5
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
6
|
+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd">
|
7
|
+
|
8
|
+
<description>
|
9
|
+
The Design ruleset contains rules that flag suboptimal code implementations. Alternate approaches
|
10
|
+
are suggested.
|
11
|
+
</description>
|
12
|
+
|
13
|
+
<!-- Rules, that have been moved into a category -->
|
14
|
+
<rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod" deprecated="true" />
|
15
|
+
<rule ref="category/java/design.xml/AvoidDeeplyNestedIfStmts" deprecated="true" />
|
16
|
+
<rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal" deprecated="true" />
|
17
|
+
<rule ref="category/java/design.xml/DataClass" deprecated="true" />
|
18
|
+
<rule ref="category/java/design.xml/FinalFieldCouldBeStatic" deprecated="true" />
|
19
|
+
<rule ref="category/java/design.xml/GodClass" deprecated="true" />
|
20
|
+
<rule ref="category/java/design.xml/ImmutableField" deprecated="true" />
|
21
|
+
<rule ref="category/java/design.xml/LogicInversion" deprecated="true" />
|
22
|
+
<rule ref="category/java/design.xml/SimplifyBooleanExpressions" deprecated="true" />
|
23
|
+
<rule ref="category/java/design.xml/SimplifyBooleanReturns" deprecated="true" />
|
24
|
+
<rule ref="category/java/design.xml/SimplifyConditional" deprecated="true" />
|
25
|
+
<rule ref="category/java/design.xml/SingularField" deprecated="true" />
|
26
|
+
<rule ref="category/java/design.xml/SwitchDensity" deprecated="true" />
|
27
|
+
<rule ref="category/java/design.xml/UseUtilityClass" deprecated="true" />
|
28
|
+
|
29
|
+
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic" deprecated="true" />
|
30
|
+
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause" deprecated="true" />
|
31
|
+
<rule ref="category/java/errorprone.xml/BadComparison" deprecated="true" />
|
32
|
+
<rule ref="category/java/errorprone.xml/CloseResource" deprecated="true" />
|
33
|
+
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals" deprecated="true" />
|
34
|
+
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod" deprecated="true" />
|
35
|
+
<rule ref="category/java/errorprone.xml/EqualsNull" deprecated="true" />
|
36
|
+
<rule ref="category/java/errorprone.xml/IdempotentOperations" deprecated="true" />
|
37
|
+
<rule ref="category/java/errorprone.xml/InstantiationToGetClass" deprecated="true" />
|
38
|
+
<rule ref="category/java/errorprone.xml/MissingBreakInSwitch" deprecated="true" />
|
39
|
+
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass" deprecated="true" />
|
40
|
+
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement" deprecated="true" />
|
41
|
+
<rule ref="category/java/errorprone.xml/NonStaticInitializer" deprecated="true" />
|
42
|
+
<rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull" deprecated="true" />
|
43
|
+
<rule ref="category/java/errorprone.xml/SimpleDateFormatNeedsLocale" deprecated="true" />
|
44
|
+
<rule ref="category/java/errorprone.xml/SingleMethodSingleton" deprecated="true" />
|
45
|
+
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance" deprecated="true" />
|
46
|
+
<rule ref="category/java/errorprone.xml/UseLocaleWithCaseConversions" deprecated="true" />
|
47
|
+
|
48
|
+
<rule ref="category/java/codestyle.xml/AvoidProtectedFieldInFinalClass" deprecated="true" />
|
49
|
+
<rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending" deprecated="true" />
|
50
|
+
<rule ref="category/java/codestyle.xml/ConfusingTernary" deprecated="true" />
|
51
|
+
<rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract" deprecated="true" />
|
52
|
+
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass" deprecated="true" />
|
53
|
+
<rule ref="category/java/codestyle.xml/UnnecessaryLocalBeforeReturn" deprecated="true" />
|
54
|
+
|
55
|
+
<rule ref="category/java/multithreading.xml/AvoidSynchronizedAtMethodLevel" deprecated="true" />
|
56
|
+
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton" deprecated="true" />
|
57
|
+
<rule ref="category/java/multithreading.xml/UnsynchronizedStaticDateFormatter" deprecated="true" />
|
58
|
+
<rule ref="category/java/multithreading.xml/UseNotifyAllInsteadOfNotify" deprecated="true" />
|
59
|
+
|
60
|
+
<rule ref="category/java/bestpractices.xml/AbstractClassWithoutAbstractMethod" deprecated="true" />
|
61
|
+
<rule ref="category/java/bestpractices.xml/AccessorClassGeneration" deprecated="true" />
|
62
|
+
<rule ref="category/java/bestpractices.xml/AccessorMethodGeneration" deprecated="true" />
|
63
|
+
<rule ref="category/java/bestpractices.xml/AvoidReassigningParameters" deprecated="true" />
|
64
|
+
<rule ref="category/java/bestpractices.xml/ConstantsInInterface" deprecated="true" />
|
65
|
+
<rule ref="category/java/bestpractices.xml/DefaultLabelNotLastInSwitchStmt" deprecated="true" />
|
66
|
+
<rule ref="category/java/bestpractices.xml/PositionLiteralsFirstInCaseInsensitiveComparisons" deprecated="true" />
|
67
|
+
<rule ref="category/java/bestpractices.xml/PositionLiteralsFirstInComparisons" deprecated="true" />
|
68
|
+
<rule ref="category/java/bestpractices.xml/PreserveStackTrace" deprecated="true" />
|
69
|
+
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault" deprecated="true" />
|
70
|
+
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty" deprecated="true" />
|
71
|
+
<rule ref="category/java/bestpractices.xml/UseVarargs" deprecated="true" />
|
72
|
+
|
73
|
+
<rule ref="category/java/performance.xml/OptimizableToArrayCall" deprecated="true" />
|
74
|
+
<rule ref="category/java/performance.xml/TooFewBranchesForASwitchStatement" deprecated="true" />
|
75
|
+
|
76
|
+
<rule ref="category/java/documentation.xml/UncommentedEmptyConstructor" deprecated="true" />
|
77
|
+
<rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody" deprecated="true" />
|
78
|
+
</ruleset>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<?xml version="1.0"?>
|
2
|
+
|
3
|
+
<projectlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4
|
+
xsi:noNamespaceSchemaLocation="projectlist_1_0_0.xsd">
|
5
|
+
<description>Standard Projects</description>
|
6
|
+
|
7
|
+
<project>
|
8
|
+
<name>checkstyle</name>
|
9
|
+
<type>git</type>
|
10
|
+
<connection>https://github.com/checkstyle/checkstyle</connection>
|
11
|
+
<tag>checkstyle-8.10</tag>
|
12
|
+
<exclude-pattern>**/src/test/resources-noncompilable/**/*</exclude-pattern>
|
13
|
+
<exclude-pattern>**/src/test/resources/**/*</exclude-pattern>
|
14
|
+
</project>
|
15
|
+
|
16
|
+
<project>
|
17
|
+
<name>spring-framework</name>
|
18
|
+
<type>git</type>
|
19
|
+
<connection>https://github.com/spring-projects/spring-framework</connection>
|
20
|
+
<tag>v5.0.6.RELEASE</tag>
|
21
|
+
</project>
|
22
|
+
|
23
|
+
<!---<project>
|
24
|
+
<name>openjdk10</name>
|
25
|
+
<type>hg</type>
|
26
|
+
<connection>http://hg.openjdk.java.net/jdk10/jdk10/jdk</connection>
|
27
|
+
<webview-url>http://hg.openjdk.java.net/jdk10/jdk10/jdk/file/777356696811</webview-url>
|
28
|
+
</project> -->
|
29
|
+
</projectlist>
|
@@ -0,0 +1,28 @@
|
|
1
|
+
<?xml version="1.0" ?>
|
2
|
+
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
|
3
|
+
<xs:element name="projectlist">
|
4
|
+
<xs:complexType>
|
5
|
+
<xs:sequence>
|
6
|
+
<xs:element name="description" type="xs:string" minOccurs="1" maxOccurs="1"/>
|
7
|
+
<xs:element name="project" type="project" minOccurs="1" maxOccurs="unbounded"/>
|
8
|
+
</xs:sequence>
|
9
|
+
</xs:complexType>
|
10
|
+
</xs:element>
|
11
|
+
<xs:complexType name="project">
|
12
|
+
<xs:sequence>
|
13
|
+
<xs:element name="name" type="xs:string" minOccurs="1" maxOccurs="1"/>
|
14
|
+
<xs:element name="type" minOccurs="1" maxOccurs="1">
|
15
|
+
<xs:simpleType>
|
16
|
+
<xs:restriction base="xs:string">
|
17
|
+
<xs:enumeration value="git"/>
|
18
|
+
<xs:enumeration value="hg"/>
|
19
|
+
</xs:restriction>
|
20
|
+
</xs:simpleType>
|
21
|
+
</xs:element>
|
22
|
+
<xs:element name="connection" type="xs:string" minOccurs="1" maxOccurs="1"/>
|
23
|
+
<xs:element name="webview-url" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
24
|
+
<xs:element name="tag" type="xs:string" minOccurs="0" maxOccurs="1"/>
|
25
|
+
<xs:element name="exclude-pattern" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
|
26
|
+
</xs:sequence>
|
27
|
+
</xs:complexType>
|
28
|
+
</xs:schema>
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'nokogiri'
|
4
|
+
require_relative '../pmd_error'
|
5
|
+
require_relative '../pmd_violation'
|
6
|
+
require_relative '../pmd_report_detail'
|
7
|
+
require_relative '../parsers/pmd_report_document'
|
8
|
+
require_relative '../report_diff'
|
9
|
+
|
10
|
+
module PmdTester
|
11
|
+
# Building difference between two pmd xml files
|
12
|
+
class DiffBuilder
|
13
|
+
# The schema of pmd xml report refers to
|
14
|
+
# http://pmd.sourceforge.net/report_2_0_0.xsd
|
15
|
+
def build(base_report_filename, patch_report_filename, base_info, patch_info, filter_set = nil)
|
16
|
+
report_diffs = ReportDiff.new
|
17
|
+
base_details, patch_details = report_diffs.calculate_details(base_info, patch_info)
|
18
|
+
base_violations, base_errors = parse_pmd_report(base_report_filename, 'base',
|
19
|
+
base_details.working_dir, filter_set)
|
20
|
+
patch_violations, patch_errors = parse_pmd_report(patch_report_filename, 'patch',
|
21
|
+
patch_details.working_dir)
|
22
|
+
report_diffs.calculate_violations(base_violations, patch_violations)
|
23
|
+
report_diffs.calculate_errors(base_errors, patch_errors)
|
24
|
+
|
25
|
+
report_diffs
|
26
|
+
end
|
27
|
+
|
28
|
+
def parse_pmd_report(report_filename, branch, working_dir, filter_set = nil)
|
29
|
+
doc = PmdReportDocument.new(branch, working_dir, filter_set)
|
30
|
+
parser = Nokogiri::XML::SAX::Parser.new(doc)
|
31
|
+
parser.parse_file(report_filename) unless report_filename.nil?
|
32
|
+
[doc.violations, doc.errors]
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|