Commit Graph

4426 Commits

Author SHA1 Message Date
Baratali Izmailov cc1b2e99c3 Issue #1243: Unsafe casts have been suppressed in UTs which use reflection 2015-08-16 06:18:12 +03:00
Baratali Izmailov 6ec212bb5e Issue #1243: Input file to resources folder 2015-08-15 15:53:21 -04:00
Roman Ivanov a15aacf77a fix for build failure 2015-08-15 14:47:45 +03:00
Michal Kordas 6370bd4a8a Do not allocate arrays of zero length. #1555
Fixes `ZeroLengthArrayInitialization` inspection violations.

Description:
>Reports on allocations of arrays with known lengths of zero. Since array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly allocating new zero-length arrays. Such sharing may provide useful optimizations in program runtime or footprint. Note that this inspection does not report zero-length arrays allocated as static final fields, as it is assumed that those arrays are being used to implement array sharing.
2015-08-15 06:46:26 +03:00
Michal Kordas e72b617d4b 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-15 06:45:50 +03:00
Michal Kordas 020d8b2469 Fix exception creation without any arguments specified. #1555
Fixes `NewExceptionWithoutArguments` inspection violation.

Description:
>Reports exception instance creation without any arguments specified. When an exception is constructed without arguments it contains no information about the fault that happened, which makes debugging needlessly hard.
2015-08-15 06:45:13 +03:00
Michal Kordas 7453d382c1 Decrease visibility of package-local class. #1555
Fixes `PackageVisibleInnerClass` inspection violation.

Description:
>Reports package-local inner classes.
2015-08-15 06:44:32 +03:00
Michal Kordas fe251ed9ff Add missing case in switch. #1555
Fixes `EnumSwitchStatementWhichMissesCases` inspection violation.

Description:
>Reports switch statements over enumerated types which do not include all of the enumerated type's elements as cases.
2015-08-15 06:43:24 +03:00
Michal Kordas 027d1e2c99 Invert conditional expressions that are negated. #1555
Fixes `NegatedConditional` inspection violations.

Description:
>Reports conditional expressions whose conditions are negated. Flipping the order of the conditional expression branches will usually increase the clarity of such statements.
2015-08-15 06:42:50 +03:00
Michal Kordas 02dfe8c7c5 Remove unnecessary this. #1555
Fixes `UnnecessaryThis` inspection violations after recent commits.

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.
2015-08-15 06:42:09 +03:00
Michal Kordas 257983bcbf Mark fields as final. #1555
Fixes `FieldMayBeFinal` inspection violations.

Description:
>Reports any fields which may safely be made final. A static field may be final if it is initialized in its declaration or in one static class initializer, but not both. A non-static field may be final if it is initialized in its declaration or in one non-static class initializer or in all constructors.
2015-08-15 06:41:30 +03:00
Ilja Dubinin 901d777e3d Coverage has been increased to 100% in CheckUtils. Issue #1290 2015-08-15 01:28:16 +01:00
Baratali Izmailov 88fcce5774 Issue #1243: Suppress warnings for UTs testing deprecated code 2015-08-14 21:44:40 +03:00
Baratali Izmailov f23a34503b Issue #1243: Useless Class variables 2015-08-14 21:39:12 +03:00
Andrei Selkin 9d74879c35 Fixed typo in JavadocMethod's examples xdocs, issue #1668 2015-08-14 21:37:13 +03:00
Baratali Izmailov cdef243543 Issue #1243: 'A generic array is created for varargs parameter' suppressed 2015-08-14 20:59:52 +03:00
Baratali Izmailov a0f2bac065 Issue #1243: Input files to resources folder 2015-08-14 20:58:20 +03:00
Baratali Izmailov 03a15583ca Issue #1243: Suppress test class with unused fields 2015-08-14 20:50:28 +03:00
Baratali Izmailov c6b421f17d Issue #1243: Input files to resources folder. 2015-08-14 20:47:41 +03:00
Ruslan Diachenko 66d73fe618 Issue #1566: MemberName and MethodName violations fixed 2015-08-14 17:00:11 +03:00
Baratali Izmailov 443e534a3c Issue #1243: Resolved varargs ambiguity 2015-08-14 16:58:43 +03:00
Ruslan Diachenko d3408eb4e4 Issue #1566: InnerTypeLast turned on 2015-08-14 16:57:33 +03:00
Ruslan Diachenko 242028813d Issue #1566: ModifiedControlVariable violations fixed 2015-08-14 16:56:18 +03:00
Andrei Selkin d808a4e4d9 Added problematic links to ignorelist of linkcheck, issue #751 2015-08-14 11:39:48 +03:00
Andrei Selkin 2e1c0147df Corrected links on web site (addition), issue #751 2015-08-14 11:39:48 +03:00
Baratali Izmailov bb5eb6c08e Issue #1243: 'Local variable is not used' fixed 2015-08-13 11:34:20 -04:00
Ilja Dubinin 7770f2a2c2 Loops have to have only one breal/continue. Issue #46 2015-08-13 07:08:02 +03:00
Michal Kordas 6a0bad784f Remove unnecessary this. #1555
Fixes `UnnecessaryThis` inspection violations after recent commits.

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.
2015-08-13 07:03:37 +03:00
Michal Kordas e9ade4ddad Remove redundant unit in zero value form CSS. #1555
Fixes `CssRedundantUnit` inspection violations.

Description:
>This inspection highlights zero values with specified unit of measurement.
2015-08-13 06:55:07 +03:00
Michal Kordas 7b34e9d7cd Do not allocate arrays of zero length. #1555
Fixes `ZeroLengthArrayInitialization` inspection violations.

Description:
>Reports on allocations of arrays with known lengths of zero. Since array lengths in Java are non-modifiable, it is almost always possible to share zero-length arrays, rather than repeatedly allocating new zero-length arrays. Such sharing may provide useful optimizations in program runtime or footprint. Note that this inspection does not report zero-length arrays allocated as static final fields, as it is assumed that those arrays are being used to implement array sharing.
2015-08-13 06:53:26 +03:00
Ruslan Diachenko 29f945e338 Issue #1566: Constructor definition in wrong order violations fixed 2015-08-13 06:51:11 +03:00
Ruslan Diachenko 677a74deee Issue #1566: ImportOrder violations fixed 2015-08-13 06:48:16 +03:00
Michal Kordas 26ffb0af87 Change name of private method conflicting with superclass method. #1555
Fixes `MethodOverridesPrivateMethod` inspection violations.

Description:
>Reports instance methods having the same name as a private method of a superclass. Such methods may result in confusing semantics, particularly if the private method is ever made publicly visible.
2015-08-13 06:45:38 +03:00
Michal Kordas 9a58272093 Remove redundant throws declarations. #1555
Fixes `RedundantThrowsDeclaration` inspection violations.

Description:
>This inspection reports exceptions that are declared in a method's signature but never thrown by the method itself.
2015-08-13 06:44:08 +03:00
Ilja Dubinin 331992aacd Coverage has been increased to 100% in CommentSuppressor. Issue #1010 2015-08-12 23:05:43 +01:00
Michal Kordas 8a6f12d9e9 Decrease visibility of constructor in abstract class. #1555
Fixes `NonProtectedConstructorInAbstractClass` inspection violation.

Description:
>Reports constructors in abstract classes that are not declared protected, package-protected or private.
2015-08-12 21:25:37 +03:00
Andrei Selkin 289ef67e9e Marked 'maxLineLength' as '@Deprecated' at LeftCurlyCheck, issue #965 2015-08-12 08:20:12 +03:00
Ruslan Diachenko 3bd699bd59 Issue #1566: HiddenField violations fixed 2015-08-12 08:19:21 +03:00
Michal Kordas fca2fd4d07 Extract nested class with other class nested to separate file. #1555
Fixes `ClassNestingDepth` inspection violation.

Description:
>Reports inner classes too deeply nested. Nesting inner classes inside inner classes is almost certain to be confusing, and is a good sign that refactoring may be necessary.
2015-08-12 08:01:55 +03:00
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