Commit Graph

3729 Commits

Author SHA1 Message Date
Michal Kordas 6839ac4fd8 Issue #2080: Add missing assertions to utils tests
Fixes some `TestMethodWithoutAssertion` inspection violations.

Description:
>Reports test methods of JUnit test case classes that do not contain any assertions. Such methods indicate either incomplete or weak test cases.
2015-09-04 14:47:31 -07:00
Vladislav Lisetskiy 45e3ec229d Issue #1214: Update all Checks html docs with link to hosted
configurations
2015-09-04 05:38:52 -07:00
Andrei Selkin 9acda0b233 Issue #1833: Fixed redundant modifier false positive for abstract classes in interfaces. 2015-09-04 05:32:51 -07:00
Ilja Dubinin 0b4ae9160b Issue #46: loops should not contain more then one break. 2015-09-03 21:24:05 -04:00
Michal Kordas f7e41edb94 Issue #2080: Replace ternary condition operator with if
Fixes `ConditionalExpression` inspection violations.

Description:
>Reports the ternary condition operator. Some coding standards prohibit the use of the condition operator, in favor of if-else statements.
2015-09-03 18:07:24 -07:00
Michal Kordas 2b4a02d2c8 Issue #2080: Fix typos in code
Fixes `SpellCheckingInspection` inspection violations introduced in recent commits.

Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals.
2015-09-03 18:06:15 -07:00
Michal Kordas b115e9afe5 Issue #2080: Replace tabs with spaces
Fixes `ProblematicWhitespace` inspection violations introduced in recent commits.

Description:
>Reports tabs used for indentation when the code style is configured to use only spaces.
2015-09-03 18:04:08 -07:00
Michal Kordas 92182aea44 Issue #1555: Rename local variables according to convention
Fixes `LocalVariableNamingConvention` inspection violations introduced in recent commits.

Description:
>Reports local variables whose names are either too short, too long, or do not follow the specified regular expression pattern.
2015-09-03 18:02:23 -07:00
Michal Kordas 1e0de782f6 Issue #1555: Use constants for empty arrays
Fixes `ZeroLengthArrayInitialization` inspection violations introduced in recent commits.

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-09-03 18:02:23 -07:00
Michal Kordas 8cf5116925 Issue #1555: Simplify JUnit assertions
Fixes `SimplifiableJUnitAssertion` inspection violations introduced in recent commits.

Description:
>Reports any JUnit assertTrue calls which can be replaced by equivalent assertEquals calls. assertEquals calls will normally give better error messages in case of test failure than assertTrue can.
2015-09-03 18:02:23 -07:00
Michal Kordas ea891b1fd0 Issue #1555: Use proper order in assertEquals assertions
Fixes `MisorderedAssertEqualsParameters` inspection violations introduced in recent commits.

Description:
>Reports any calls to JUnit assertEquals() which have a non-literal as the expected result argument and a literal as the actual result argument. Such calls will behave fine for assertions which pass, but may give confusing error reports if their expected and actual arguments differ.
2015-09-03 18:02:23 -07:00
Michal Kordas ee7d6e9df3 Issue #1555: Add locale to lower case conversion
Fixes `StringToUpperWithoutLocale` inspection violations introduced in recent commits.

Description:
>Reports any call of toUpperCase() or toLowerCase() on String objects which do not specify a java.util.Locale. Such calls are usually incorrect in an internationalized environment.
2015-09-03 18:02:23 -07:00
Michal Kordas 9ce956473b Issue #1555: Add argument to exception constructor call
Fixes `NewExceptionWithoutArguments` inspection violations introduced in recent commits.

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-09-03 18:02:23 -07:00
Michal Kordas dd7935491a Issue #1555: Narrow scope of variable
Fixes `TooBroadScope` inspection violations introduced in recent commits.

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-09-03 18:02:23 -07:00
Michal Kordas 2085758156 Issue #1555: Replace qualifier with an import
Fixes `UnnecessaryFullyQualifiedName` inspection violations introduced in recent commits.

Description:
>Reports on fully qualified class names which can be shortened. The quick fix for this inspection will shorten the fully qualified names, adding import statements as necessary.
2015-09-03 18:02:23 -07:00
Michal Kordas a3daead123 Issue #2065: Add suppression for IntelliJ IDEA inspection as comment 2015-09-03 21:47:35 +02:00
Vladislav Lisetskiy 6389959930 Issue #2064: ignore classes nested in interaces or annotations in Final
Class Check
2015-09-03 11:11:56 -07:00
Vladislav Lisetskiy c569113723 Issue #2063: Create separate web page for old release notes 2015-09-03 13:52:12 -04:00
Vladislav Lisetskiy f66dcdbd94 Issue #1530: Detect nested enums marked as static in RedundantModifier
check
2015-09-03 06:45:44 -07:00
Andrei Selkin 860e442d53 Issue #1900: Extended javadoc/xdoc for RightCurlyCheck. 2015-09-03 06:34:06 -07:00
Andrei Selkin 8f5c67b836 Issue #1900: Extended violation message for right curly brace policy 'same'. 2015-09-03 06:34:06 -07:00
Andrei Selkin 0689f76ab3 Issue #1903: Fixed NPE in MutableExceptionCheck.isExtendedClassNamedAsException . 2015-09-03 06:17:12 -07:00
Andrei Selkin 0b23dba45a Issue #945: Added UT which validates that all checks which exist in classpath are referenced in checkstyle_checks.xml. 2015-09-03 06:11:18 -07:00
Andrei Selkin ab4bce61c5 Issue #945: Added 'IllegalCatch' into checkstyle_checks.xml. 2015-09-03 06:11:18 -07:00
Vladislav Lisetskiy 1455655c75 Issue #2074: Correct SummuryJavadoc IT 2015-09-03 06:05:15 -07:00
Vladislav Lisetskiy 54c907e6ae Issue #2062: Change message in SummaryJavadocCheck 2015-09-03 06:04:13 -07:00
Michal Kordas 137caa82cb Issue #2065: Add suppression for IntelliJ IDEA inspection
Inspection in this case is right. Parameter `Properties` can be replaced with `Map<Object, Object>`. It works fine with Checkstyle, but it breaks binary compatiblity with Maven Checkstyle Plugin, which is not acceptable.
2015-09-03 05:55:42 -07:00
Andrei Selkin 0b6d22e69b Issue #2029: New option 'switchBlockAsSingleDecisionPoint' for CyclomaticComplexityCheck. 2015-09-03 05:51:41 -07:00
Ilja Dubinin 4ea84c811b Issue #1290: Coverage has been increased to 100% in AbstractTypeAwareCheck and nested classes 2015-09-03 05:39:43 -07:00
Ilja Dubinin c6c9ad9d33 Issue #1290: coverage has been increased to 100% in TranslationCheck 2015-09-03 05:34:28 -07:00
Ilja Dubinin 2c6e941a26 Issue #1290: Coverage has been increased to 100% in NewLineAtTheEndOfFileCheck 2015-09-03 01:00:31 +01:00
Michal Kordas 14db0ec7e9 Tidy up in release notes 2015-09-02 09:38:01 +02:00
Andrei Selkin ed280ebd0b Minor: refactoring of TreeWalker to increase readability 2015-09-01 21:51:26 -07:00
Andrei Selkin 6f7dfc3c69 Corrected javadoc/xdoc for IllegalTypeCheck 2015-09-01 21:50:33 -07:00
Ilja Dubinin 8607274a92 Issue #46: Loops should not contain more than a single 'break' or 'continue' statement 2015-09-01 21:47:52 -07:00
Ilja Dubinin 6e775898e7 Issue #46: Statements shouldn't be nested too deep. 2015-09-01 20:01:26 +01:00
Roman Ivanov ac4b253d1d release notes 6.10.1 2015-09-01 08:52:16 -07:00
Roman Ivanov af95472a09 Issue #2065: broken compatibility with maven-checkstyle-plugin:2.15 at checkstyle:6.10 2015-09-01 07:24:43 -07:00
Roman Ivanov c1e40c92a0 release notes 6.10 2015-08-31 23:12:04 -07:00
Roman Ivanov 092dd6864f minor: fix for incorrect link 2015-08-31 23:11:25 -07:00
Roman Ivanov 5a52ced14e doc: fix for issue commit message format 2015-08-31 22:16:10 -07:00
Roman Ivanov 3cef81032c Issue #1678: Enable Checkstyle checks for 'gui' package 2015-08-31 21:37:06 -07:00
Michal Kordas b9bdf9f8e1 Issue #1555: Instructions to enable IntelliJ IDEA Inspections 2015-08-31 21:13:47 -07:00
Michal Kordas 2d8f5576bb Issue #1555: Refer to collections by interface
Fixes `DeclareCollectionAsInterface` inspection violations.

Description:
>Reports on declarations of Collection variables made by using the collection class as the type, rather than an appropriate interface.
2015-08-31 21:13:04 -07:00
Michal Kordas 5c5eafaa7e Issue #1555: Replace constructor with setUp() in JUnit test case
Fixes `TestCaseWithConstructor` inspection violations.

Description:
>Reports on JUnit test cases with initialization logic in their constructors. Initialization of JUnit test cases should be done in setUp() methods instead.
2015-08-31 21:11:14 -07:00
Michal Kordas 5a46bdbeea Issue #1555: Remove unnecessary unboxing
Fixes `UnnecessaryUnboxing` inspection violations.

Description:
>Reports "unboxing", e.g. explicit unwrapping of wrapped primitive values. Unboxing is unnecessary under Java 5 and newer, and can be safely removed.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
2015-08-31 21:11:14 -07:00
Michal Kordas eb31210db6 Issue #1555: Remove unnecessary boxing
Fixes `UnnecessaryBoxing` inspection violations.

Description:
>Reports "boxing", e.g. wrapping of primitive values in objects. Boxing is unnecessary under Java 5 and newer, and can be safely removed.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
2015-08-31 21:11:14 -07:00
Baratali Izmailov 5ca472faa6 Issue #1243: Eclipse warnings about unused fields have been fixed. 2015-08-31 21:10:32 -07:00
Michal Kordas 8373465620 Issue #2054: Simplify overqualified CSS element
Fixes `Element (a.dl-link) is overqualified, just use .dl-link without element name.`

Description:
>Using selector like the one bellow is almost every time unnecessary, unless the element name causes the class to behave differently you can omit it. With this you will shrink the file size and speedup your page load time.
2015-08-31 21:10:01 -07:00
Michal Kordas d8418e5ab0 Issue #2054: Remove empty CSS rule
Fixes `Rule is empty` inspection violations.

Description:
>An empty rule is one that doesn't contain any properties, such as:
 ```
  .foo {
  }
```
A lot of times, empty rules appear as a result of refactoring without further cleanup. Eliminating empty rules results in smaller file sizes and less style information for the browser to deal with.
2015-08-31 21:10:01 -07:00