12801 Commits

Author SHA1 Message Date
Juan Martín Sotuyo Dodero
13f0c8000a [java] Don't report UseUtilityClass when extending
- Since the parent class is not a utility, we are neither (the parent
class may have non-static methods and fields).
 - Since this is more general than the original check for exception
types, we remove that
 - Fixes #824
 - Take the chance to have the rule use the rulechain
2018-05-12 02:06:42 -03:00
Juan Martín Sotuyo Dodero
9b3fcc2608 [java] Simplify LongInstantiation and IntegerInstantiation
- Narrow down both rule's search space (therefore making better usage
of the rulechain and reducing number of checks performed)
 - Use type resolution to simplify the rules and avoid FPs when
declaring classes with the same names
2018-05-12 01:37:59 -03:00
Juan Martín Sotuyo Dodero
a378299978 Use type resolution for AvoidThrowingRawExceptionTypes
- Fixes the false negatives
 - Is actually 100X faster as we avoid all those `//ImportDeclaration`
2018-05-12 01:06:38 -03:00
Juan Martín Sotuyo Dodero
43839bd772 Failing test case for AvoidThrowingRawExceptionTypes 2018-05-12 01:03:33 -03:00
Juan Martín Sotuyo Dodero
1e73b8c0c5 Further cleanups 2018-05-11 01:14:26 -03:00
Juan Martín Sotuyo Dodero
d4c016d19d Update changelog, refs #1080 2018-05-10 20:56:24 -03:00
Juan Martín Sotuyo Dodero
85d3089413 Fix copy paste 2018-05-10 20:53:22 -03:00
Juan Martín Sotuyo Dodero
cf914f424d [core] Hack to get Ant's log level
- Very ugly, uses reflection and is limited to the few
implementatations that come with Ant itself or and testutils
 - Intended as a starting point for fixing #1018
2018-05-10 20:53:22 -03:00
Juan Martín Sotuyo Dodero
254c08ea75 Rework into an autoclosable
- Allow callers to simply use a try-with-resources around the measured
code
2018-05-10 20:23:52 -03:00
Juan Martín Sotuyo Dodero
c51fac8dad Better handle mono-thread case 2018-05-09 19:29:54 -03:00
Juan Martín Sotuyo Dodero
0e1b565d03 Minor cleanups 2018-05-09 19:18:43 -03:00
Juan Martín Sotuyo Dodero
21ee3f76ed Merge branch 'pr-1085' 2018-05-09 19:14:06 -03:00
Juan Martín Sotuyo Dodero
1fc1797281 Update changelog, refs #1085 2018-05-09 19:13:49 -03:00
Clément Fournier
329e092e00 Make ClassNamingConventions' utility class definition more precise
Classes which have a superclass or implement an interface are not flagged
as utility classes anymore.
2018-05-08 19:41:17 +02:00
Andreas Dangel
ad4166e300 Merge branch 'pr-1083' 2018-05-08 09:17:40 +02:00
Andreas Dangel
5b0ea25f04 Update release notes, fixes #1077, refs #1083 2018-05-08 09:17:23 +02:00
Clément Fournier
a8bd283545 Fix lambda qname infix in enum constants 2018-05-08 01:31:08 +02:00
Juan Martín Sotuyo Dodero
bcb3f65edb Avoid NPE 2018-05-07 02:43:34 -03:00
Juan Martín Sotuyo Dodero
fb55ca703e Also keep lambdas in a single scope 2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
c8b34b0dec Simplify test 2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
980c72a10a Simplify constructor scopes 2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
eec6ad88c8 Update changelog, refs #1068 2018-05-06 20:42:51 -03:00
Juan Martín Sotuyo Dodero
5de405d23f [java] Fix scoping inconsistencies
- Reduce LocalScope creations. Method parameters and method locals have
the same visibility / reachability, so they should be in the same scope.
 - Fix the grammar `assert` lookahead. There is no need to use `(`
 - Fix illegal test code (shadowing of parameters is illegal)
 - Update Scope tests to deal with changes
 - Fixes #1051
2018-05-06 20:42:33 -03:00
Juan Martín Sotuyo Dodero
2f4d852017 Use the right import 2018-05-03 21:45:52 -03:00
Juan Martín Sotuyo Dodero
0bb75c2ce0 Changes requested by reviewer 2018-05-03 21:41:05 -03:00
Clément Fournier
dd2dcf6357 Merge branch 'pr-1071' 2018-05-03 23:43:59 +02:00
Juan Martín Sotuyo Dodero
8af01d6565 [core] Rework benchmarking code
The old implementation had many limitations:
 - Relayed ALL measuring logic to the client
 - Used `synchronized` methods
 - Was unable to measure nested operations without mixing values
 - Mixed wall-clock and CPU time, which caused trouble when running
multithreaded analysis (negative values for non-meassured time)
 - A separate `main` existed which was undocumented and unsupported.

So I reworked it and added some goodies along the way:
 - When not running in benchmark mode, all operations are NOOPs
 - Nested operations are the default. Total and self time are
differentiated. This allows and encourages to better track overhead (ie:
time spent in a loop over another timed operation)
 - We can meassure call count along with custom counters, which add
meaning to metrics
 - Wall clock time for total execution is separated from all other CPU
times
 - All meassurements are done by the `TimeTracker` itself
 - No `synchronized` use, all structs are thread-safe and lock as little
and sporadically as possible
 - Categories can be split up by labels
 - The tracker is generic, has little knowledge of what is being
tracked. Same applies to report rendering. This is extremely flexible to
add more and custom tracks in the future
2018-05-02 12:31:53 -03:00
Juan Martín Sotuyo Dodero
863083d1a8 Merge branch 'pr-1072' 2018-05-01 14:55:40 -03:00
Clément Fournier
08a37c75cb Avoid some unnecessary computations
They're possibly expensive, eg tree traversal
2018-05-01 18:16:08 +02:00
Andreas Dangel
8201ec984a [java] Use multiple threads for PMDCoverageTest 2018-05-01 16:48:29 +02:00
Andreas Dangel
60ac38cd71 [java] Update PMDCoverageTest to verify stderr now 2018-05-01 16:48:29 +02:00
Andreas Dangel
d85db07196 [core] Report exceptions thrown during rule execution 2018-05-01 16:48:24 +02:00
Juan Martín Sotuyo Dodero
0d56d76226 Update changelog, refs #1071 2018-04-30 19:04:43 -03:00
Juan Martín Sotuyo Dodero
7a5ff4fcfc [java] Fix false-positives on PrematureDeclaration
- The code failed to detect closures once we enforced find boundaries,
so we now explicitely ask to cross them
2018-04-30 19:02:53 -03:00
Juan Martín Sotuyo Dodero
5ce1bc331f Merge branch 'pr-1069' 2018-04-30 15:53:59 -03:00
Juan Martín Sotuyo Dodero
046d219fb1 Update changelog, refs #1069 2018-04-30 15:53:09 -03:00
Travis CI (pmd-bot)
618de0bb33 Update documentation 2018-04-30 18:09:23 +00:00
Juan Martín Sotuyo Dodero
69ab78accc Merge branch 'pr-1070' 2018-04-30 14:58:16 -03:00
Clément Fournier
7810c893a3 Checkstyle 2018-04-30 18:34:59 +02:00
Clément Fournier
30774b9ccc Update release notes, refs #1070
Closes #1065
2018-04-30 18:28:56 +02:00
Clément Fournier
f8e7b778db Allow numbers in class names 2018-04-30 18:26:05 +02:00
Clément Fournier
d34fd86735 Fix static and private method overriding 2018-04-30 17:58:22 +02:00
Clément Fournier
2abd5c5a59 Fix protected Object members in interface should not be overridden 2018-04-30 17:35:06 +02:00
Andreas Dangel
c6716388b9 Prepare next development version 2018-04-29 09:57:56 +02:00
Andreas Dangel
85874e7e9c [maven-release-plugin] prepare for next development iteration 2018-04-29 09:54:45 +02:00
Andreas Dangel
10c66fbf38 [maven-release-plugin] prepare release pmd_releases/6.3.0 pmd_releases/6.3.0 2018-04-29 09:54:36 +02:00
Andreas Dangel
1c93a66747 Prepare pmd release 6.3.0 2018-04-29 09:48:03 +02:00
Andreas Dangel
f0b3ca893e Fix unit test 2018-04-28 20:58:21 +02:00
Andreas Dangel
7d46c453c2 Merge branch 'pr-945' 2018-04-28 20:53:46 +02:00
Travis CI (pmd-bot)
109de192ed Update documentation 2018-04-28 18:35:14 +00:00