Commit Graph

4387 Commits

Author SHA1 Message Date
Michal Kordas ea06b2fb96 Decrease visibility of inner classes. #1555
Fixes `PackageVisibleInnerClass` inspection violation.

Description:
>Reports package-local inner classes.
2015-08-12 08:00:24 +03:00
Michal Kordas c4928f486c Decrease scope of variables. #1555
Fixes `TooBroadScope` inspection violations.

Description:
>Reports any variable declarations of which the scope can be narrowed. Especially useful for "Pascal style" declarations at the start of a method, but variables with too broad a scope are also often left over after refactorings.
2015-08-12 07:54:42 +03:00
Michal Kordas ba9639e5de Move constants to right side in comparisons. #1555
Fixes ` ConstantOnLHSOfComparison` inspection violations.

Description:
>Reports on comparison operations with constant values on their left-hand side. Some coding conventions specify that constants should be on the right-hand side of comparisons.
2015-08-12 07:53:59 +03:00
Michal Kordas 0da6b95ae7 Prevent classes to escape their scope. #1555
Fixes `ClassEscapesItsScope` inspection violation.

Description:
>Reports any references to classes which allow the class name to be used outside the class's stated scope. For instance, this inspection would report a public method which returns a private inner class, or a protected field whose type is a package-visible class. While legal Java, such references can be very confusing, and make reuse difficult.
2015-08-11 23:55:37 +03:00
Michal Kordas e13ff7caab Fix headers for classes in 'gui' package. #945 2015-08-11 23:42:51 +03:00
Baratali Izmailov 32bd618b19 Issue #1243: Generic types should be parameterized 2015-08-11 23:19:16 +03:00
Michal Kordas 82d8e91024 Remove unnecessary qualifiers. #1555
Fixes `UnnecessarilyQualifiedStaticUsage` inspection violations.

Description:
>Reports calls to static methods or accesses of static fields on the current class which are qualified with the class name. Such qualification is unnecessary, and may be safely removed.
2015-08-11 23:14:01 +03:00
Baratali Izmailov 521dacce75 Updated docs of DeclarationOrderCheck 2015-08-11 15:51:21 +03:00
Baratali Izmailov 772d2e9afc Issue #1243: 'Class is raw type' fixed 2015-08-11 15:48:23 +03:00
Ilja Dubinin d66b75bd7f Coverage has been increased to 100% in DetectorOptions. Issue #1010 2015-08-11 15:44:01 +03:00
Michal Kordas b8eeaaeb42 Remove obsolete method with casting that looses precision. #1555
Fixes `CastThatLosesPrecision` inspection violation.

Description:
>Reports any cast operations between built-in numeric types which may result in loss of precision. Such casts are not necessarily a problem, but may result in difficult to trace bugs if the loss of precision is unexpected.
2015-08-11 15:28:49 +03:00
Michal Kordas f5f1d754e2 Remove unnecessary @inheritDoc tags. #1555
Fixes `UnnecessaryInheritDoc` inspection violations.

Description:
>Reports any Javadoc comments which contain only the {@inheritDoc} tag. Since Javadoc copies the super class' comment if no comment is present, a comment containing only an {@inheritDoc} adds nothing.
2015-08-11 15:22:31 +03:00
Baratali Izmailov 1935bed577 Replace <code> tags with {@code ...} constructs. #1555
Fixes `HtmlTagCanBeJavadocTag` inspection violations.

Description:
>Reports use of <code> tags in Javadoc comments. Since JDK1.5 these constructs may be replaced with {@code ...} constructs. This allows the use of angle brackets (<, >) inside the comment, instead of HTML character entities.
2015-08-11 15:18:59 +03:00
Ilja Dubinin 1b5f357c33 Transient has been deleted from non-serializable classes. Issue #46 2015-08-11 15:01:26 +03:00
Ilja Dubinin 5cacb9a18b Deprecated methods have been removed. Issue #46 2015-08-11 14:58:32 +03:00
Baratali Izmailov d3864bcda3 VariableDeclarationUsageCheck has been removed from coverage configs 2015-08-10 16:56:57 +03:00
Baratali Izmailov 595f45c428 Issue #1293. VariableDeclarationUsageCheck refactroing. Useless variable definition check. 2015-08-10 16:56:57 +03:00
Baratali Izmailov 495d54c753 Issue #1293. VariableDeclarationUsageCheck refactoring. Useless variable check in 'switch' statement 2015-08-10 16:56:57 +03:00
Baratali Izmailov c4339df8b3 Issue #1293. Improved coverage for VariableDecalarationUsageCheck. 2015-08-10 16:56:57 +03:00
Ilja Dubinin aa0f77eb92 Coverage has been increased to 100% in MultilineDetector. Issue #1010 2015-08-10 13:46:39 +03:00
Andrei Selkin b42c26a8cd Restricted suppression for gui-package, issue #1555 2015-08-10 10:14:28 +03:00
Michal Kordas 1390091990 Return unmodifiable collections from methods. #1555
Fixes `ReturnOfCollectionField` inspection violations.

Description:
>Reports any attempt to return an array or Collection field from a method. Since the array or Collection may have its contents modified by the calling method, this construct may result in an object having its state modified unexpectedly. While occasionally useful for performance reasons, this construct is inherently bug-prone.
2015-08-10 09:47:58 +03:00
Michal Kordas 86826e1fa3 Invert if statements with negated conditions. #1555
Fixes `NegatedIfElse` inspection violations.

Description:
>Reports if statements which contain else branches and whose conditions are negated. Flipping the order of the if and else branches will usually increase the clarity of such statements.
2015-08-10 09:46:46 +03:00
Andrei Selkin d0939d3bc9 Corrected links on website, issue #751 2015-08-09 18:49:19 +03:00
Michal Kordas 24291cf8c8 Remove unnecessary calls to superclass constructors. #1555
Fixes `UnnecessarySuperConstructor` inspection violations.

Description:
>Reports any no-argument calls to a superclass constructor as the first call of a constructor. Such calls are unnecessary, and may be removed.
2015-08-09 17:44:06 +03:00
Michal Kordas 6d5c0da42f Remove unnecessary this keyword. #1555
Fixes `UnnecessaryThis` inspection violations.

Description:
>Reports on any unnecessary uses of this in the code. Using this to disambiguate a code reference may easily become unnecessary via automatic refactorings, and is discouraged by many coding styles.
 For example:
 ```
 this.a = 3;
 ```
2015-08-09 17:41:42 +03:00
Michal Kordas 85d6fcba9c Use isEmpty() instead of "".equals() on strings. #1555
Fixes `StringEqualsEmptyString` inspection violations.

Description:
>Reports .equals() being called to compare a String with an empty string. It is normally more performant to test a String for emptiness by comparing its .length() to zero instead.
2015-08-09 17:38:47 +03:00
Michal Kordas d8bacb1e5d Fix confusing floating point literals. #1555
Fixes `ConfusingFloatingPointLiteral` inspection violations.

Description:
>Reports any floating point numbers which do not have a decimal point, numbers before the decimal point, and numbers after the decimal point. Such literals may be confusing, and violate several coding standards.
2015-08-09 17:37:44 +03:00
Michal Kordas 1650f48269 Fix dangling Javadoc comments. #1555
Fixes `DanglingJavadoc` inspection violations.

Description:
>Reports dangling Javadoc comments. Javadoc comment are dangling if they don't belong to any class, method or field. For example a Javadoc comment in between method declarations that have their own javadoc comments.
2015-08-09 17:37:01 +03:00
Michal Kordas 5311fb5484 Remove trailing whitespace from XML files. #1555 2015-08-09 16:08:03 +02:00
Ruslan Diachenko 6e6f2052a6 Issue #1566: unused imports removed 2015-08-09 14:21:49 +03:00
Ruslan Diachenko 5ad526a761 Issue #1566: incorrect indentation fixed 2015-08-09 08:13:04 +01:00
Ruslan Diachenko 39e6f8e86c Issue #1566: Constructor definition in wrong order fixed 2015-08-09 07:43:29 +01:00
Ruslan Diachenko 9e90fceb77 Issue #1566: AnnonInnerLength violations fixed 2015-08-09 09:23:29 +03:00
Ruslan Diachenko 0f4494ebeb Issue #1566: 'Fields and methods should be before inner classes' violations fixed 2015-08-09 06:01:43 +01:00
Ruslan Diachenko 93914f360e Issue #1566: Line cannot start with this symbol violations fixed 2015-08-09 05:53:49 +03:00
Ruslan Diachenko 71e1707a3f Issue #1566: Line has trailing spaces violations fixed 2015-08-09 05:50:58 +03:00
Ruslan Diachenko 39085d27c1 Issue #1566: First sentence should end with a period violations fixed 2015-08-09 05:49:20 +03:00
Ruslan Diachenko 61f90aee7e Issue #1566: '(' should be on the previous line fixed 2015-08-09 05:47:48 +03:00
Ruslan Diachenko 6bb0d26301 Issue #1566: column X should be alone on a line fixed 2015-08-09 05:46:48 +03:00
Ruslan Diachenko 801db8ed46 Issue #1566: JavadocMethod @return violations fixed 2015-08-09 05:42:54 +03:00
Ruslan Diachenko 93a6487be7 Issue #1566: WhitespaceAfter, DeclarationOrder, ArrayTrailingComma, ParenPad violations fixed 2015-08-09 05:40:23 +03:00
Ruslan Diachenko b4e1e170c8 Issue #1566: '&&' should be on a new line' fixed 2015-08-09 05:38:49 +03:00
Andrei Selkin a73868f2d3 Set parameter 'failOnError' of maven javadoc plugin to true, issue #291. 2015-08-09 05:36:43 +03:00
Andrei Selkin 75ed7a6d25 Resolved javadoc problems that reported by java 8 at CommentsIndentationCheck, issue #291. 2015-08-09 05:36:43 +03:00
Baratali Izmailov 16ae5032c5 Issue #1293: Improved coverage for IllegalInstantiationCheck 2015-08-09 05:32:39 +03:00
Michal Kordas 0dbbf3b83a Suppress wrong root element in tests. #1555 2015-08-09 05:30:27 +03:00
Michal Kordas f7f377f506 Remove redundant throws declarations. #1555
Fixes `RedundantThrows` inspection violations.

Description:
>This inspection reports exceptions that are declared in a method's signature but never thrown by the method itself or its implementations/derivatives.
2015-08-09 05:28:36 +03:00
Michal Kordas 57d522e209 Refactor anonymous classes with too many methods. #1555
Fixes `AnonymousClassMethodCount` inspection violation.

Description:
>Reports anonymous inner class with too many methods. Anonymous classes with more than a very low number of methods may be difficult to understand, and should probably be promoted to become named inner classes.
2015-08-09 05:27:09 +03:00
Michal Kordas 2915ccf21a Add SuppressWarnings for known deprecation. #1555
Fixes `Deprecation` inspection violation.

Description:
>This inspection reports where deprecated code is used in the specified inspection scope.
2015-08-09 05:25:45 +03:00