Commit Graph

4800 Commits

Author SHA1 Message Date
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
Michal Kordas 4587090b83 Issue #1555: Extract classes to the upper level
Fixes `PackageVisibleInnerClass` inspection violations.

Description:
>Reports package-local inner classes.
2015-08-31 21:08:09 -07:00
Michal Kordas de2c3f153e Issue #1555: Remove redundant initializer
Fixes `UnusedAssignment` inspection violation.

Description:
>This inspection points out the cases where a variable value
2015-08-31 21:06:39 -07:00
Roman Ivanov 72b7300c98 minor: ordering in config 2015-08-31 13:48:48 -07:00
Baratali Izmailov 49a0ee8171 Issue #1566: Fixed SummaryJavadocCheck violations. 2015-08-31 15:58:35 -04:00
Ilja Dubinin faa8a0b7a4 Issue #46. Statements shouldn't be nested too deep 2015-08-31 12:49:02 -07:00
Michal Kordas 1a205d4b43 Issue #1555: Rename parameters to match names in overridden methods
Fixes `ParameterNameDiffersFromOverriddenParameter` inspection violation.

Description:
>Reports parameters that have different names from the corresponding parameters in the methods they override. While legal in Java, such inconsistent names may be confusing, and lessen the documentation benefits of good naming practices.
2015-08-31 12:28:57 -07:00
Ruslan Diachenko bca6d627ac Issue #1566: WriteTag violations fixed 2015-08-31 20:14:01 +01:00
Ruslan Diachenko c899af31c1 Issue #1566: JavadocParagraph violations fixed 2015-08-31 19:51:27 +01:00
Baratali Izmailov 2b861bd6e1 Issue #1566: Fix for SummaryJavadocCheck's violations (partial) 2015-08-31 14:24:26 -04:00
Ruslan Diachenko a1128cd742 Issue #1566: JavadocTagContinuationIndentation violations fixed 2015-08-31 18:43:28 +01:00
Baratali Izmailov 5ca9667952 Issue #1566: Fix for SummaryJavadocCheck's violations (partial) 2015-08-31 13:02:55 -04:00
Baratali Izmailov cf85a72f3d Issue #1566: Fix for SingleLineJavadoc's violations 2015-08-31 11:49:51 -04:00
Ruslan Diachenko d410b2a21c Issue #1566: ClassFanOutComplexity turned on 2015-08-31 08:11:34 -07:00
Roman Ivanov 87a56e240e config: maven-enforcer-plugin and equalsverifier are updated to newest version 2015-08-31 07:30:03 -07:00
Ruslan Diachenko 54ff2757df Issue #1566: OverloadMethodsDeclarationOrder violations fixed 2015-08-31 06:58:02 -07:00
Ruslan Diachenko 39f752cd88 Issue #1566: VariableDeclarationUsageDistance violations fixed 2015-08-31 14:17:55 +01:00
Roman Ivanov 3b6beec969 Issue 1566: grouping of Checks and activate some of them 2015-08-30 23:13:33 -07:00
Roman Ivanov dd0c697902 Issue 1566: comment was added to ignored Checks 2015-08-30 22:55:52 -07:00
Michal Kordas 879864502b Issue #1555: Rename parameters to match names
Fixes `ParameterNameDiffersFromOverriddenParameter` inspection violation.

Description:
>Reports parameters that have different names from the corresponding parameters in the methods they override. While legal in Java, such inconsistent names may be confusing, and lessen the documentation benefits of good naming practices.
2015-08-30 22:13:06 -07:00
Michal Kordas 4b95f33697 Issue #1555: Collapse if statement
Fixes `IfStatementWithIdenticalBranches` inspection violation.

Description:
>Reports if statements with identical "then" and else branches. Such statements are almost certainly programmer error.
2015-08-30 22:12:38 -07:00
Michal Kordas 74566f21a2 Issue #1555: Replace if with switch
Fixes `IfStatementWithTooManyBranches` inspection violation.

Description:
>Reports if statements with too many branches. Such statements may be confusing, and are often the sign of inadequate levels of design abstraction.
2015-08-30 22:12:38 -07:00
Michal Kordas a4e3e3c1af Issue #1555: Narrow scope of variables
Fixes `TooBroadScope` inspection violation.

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-30 22:12:38 -07:00
Ruslan Diachenko 5922d5a673 Issue #1566: IllegalCatch violations fixed for TreeWalker 2015-08-30 22:06:24 -07:00
Ruslan Diachenko 3ef918920c Issue #1566: IllegalCatch violations fixed for CheckstyleAntTask 2015-08-30 22:04:08 -07:00
Ruslan Diachenko d740f2e1cd Issue #1566: IllegalCatch violations fixed for Checker 2015-08-30 22:02:37 -07:00
Roman Ivanov 83b0e16b0a Issue 1566: all Checks are activated with ignore severity 2015-08-30 14:08:04 -07:00
Baratali Izmailov d693562ab7 Issue #1243: Coverage of DeclarationOrderCheck has been improved 2015-08-30 09:34:48 -07:00
Baratali Izmailov aa581847fe Issue #2031: 'ignoreMethods' option has been removed from DeclarationOrderCheck 2015-08-30 09:34:48 -07:00
Baratali Izmailov a960c379bc Issue #1566: CyclomaticComplexityCheck activated in checkstyle_checks 2015-08-30 06:54:15 -07:00
Baratali Izmailov b576ccf879 Issue #1566: Fixed CyclomaticComplexity violations in RightCurlyCheck 2015-08-30 06:54:15 -07:00
Baratali Izmailov 11eb99681a Issue #1566: Fixed CyclomaticComplexity violations in IndentationCheckTest 2015-08-30 06:54:15 -07:00
Baratali Izmailov 9c21acf16a Issue #1566: Fixed CyclomaticComplexity violations in RegexpHeaderCheck 2015-08-30 06:54:15 -07:00
Michal Kordas e89837b42e Issue #1555: Mark methods as static
Fixes `MethodMayBeStatic` inspection violation.

Description:
>Reports any methods which may safely be made static. A method may be static if it is not synchronized, it does not reference any of its class' non static methods and non static fields and is not overridden in a sub class.
2015-08-30 06:53:28 -07:00
Michal Kordas e1a2e66b26 Issue #1555: Replace while with foreach
Fixes `WhileCanBeForeach` inspection violation.

Description:
>Reports while loops which iterate over collections, and can be replaced with the foreach iteration syntax, which is available in Java 5 and newer.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
2015-08-30 06:53:28 -07:00
Michal Kordas 190ce3850f Issue #1555: Make return collection 'unmodifiable'
Fixes `ReturnOfCollectionField` inspection violation.

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-30 06:53:28 -07:00
Michal Kordas bf4a253173 Issue #1555: Avoid reuse of local variables
Fixes `ReuseOfLocalVariable` inspection violation.

Description:
>Reports local variables that are "reused", overwriting their values with new values unrelated to their original use. Such local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs, if code changes result in values that were thought to be overwritten actually being live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.
2015-08-30 06:53:28 -07:00
Michal Kordas b69c169934 Issue #1555: Remove unused assignment
Fixes `UnusedAssignment` inspection violations.

Description:
>This inspection points out the cases where a variable value is never used after its assignment, i.e.:
  - the variable never gets read after assignment OR
  - the value is always overwritten with another assignment before the next variable read OR
  - the variable initializer is redundant (for one of the above two reasons) OR
  - the variable is never used.
2015-08-30 06:53:28 -07:00
Michal Kordas f5e4d9b42a Issue #1555: Use try-with-resources to close streams in test code
The issue was stream not being closed at all or closed, but not in finally block.

Fixes some `IOResource` inspection violations.

Description:
>Reports any I/O resource which is not safely closed in a finally block. Such resources may be inadvertently leaked if an exception is thrown before the resource is closed. I/O resources checked by this inspection include java.io.InputStream, java.io.OutputStream, java.io.Reader, java.io.Writer and java.io.RandomAccessFile. I/O resources which are wrapped by other I/O resources are not reported, as the wrapped resource will be closed by the wrapping resource.
2015-08-30 10:21:15 +02:00
Ilja Dubinin 7e1062dea1 Issue #46. statements shouldn't be nested too deep 2015-08-29 22:52:31 -07:00
Ilja Dubinin 603c5bb53e Issue #46: Statements shouldn't be nested too deep 2015-08-29 22:46:58 -07:00
Michal Kordas 7b8a3aa5bb Issue #1555: Fix various typos
Fixes `SpellCheckingInspection` inspection violation.

Description:
>Spellchecker inspection helps locate typos and misspelling in your code, comments and literals
2015-08-29 22:38:45 -07:00
Michal Kordas b372cfa0a8 Issue #1555: Collapse and refactor if statement with identical branches
Fixes `IfStatementWithIdenticalBranches` inspection violation.

Description:
>Reports if statements with identical "then" and else branches.
2015-08-29 22:36:29 -07:00
Michal Kordas f293a21076 Issue #1555: Flip negated if-else
Fixes `NegatedIfElse` inspection violation.

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-29 22:35:08 -07:00
Michal Kordas e81ca8290b Issue #1555: Avoid reuse of local variables
Fixes `ReuseOfLocalVariable` inspection violation.

Description:
>Reports local variables that are "reused", overwriting their values with new values unrelated to their original use. Such local variable reuse may be confusing, as the intended semantics of the local variable may vary with each use. It may also be prone to bugs, if code changes result in values that were thought to be overwritten actually being live. It is good practices to keep variable lifetimes as short as possible, and not reuse local variables for the sake of brevity.
2015-08-29 22:34:14 -07:00
Michal Kordas 2ed00e0af3 Issue #1555: Delete unnecessary imports
Fixes `UnusedImport` inspection violations.

Description:
>Reports any import statements that are unused. Since IDEA can automatically detect and fix such statements with its "Optimize Imports" command, this inspection is mostly useful for off-line reporting on code bases that you don't intend to change.
2015-08-29 22:33:18 -07:00
Michal Kordas 1dcb4b201f Issue #1555: Convert method with array parameter to vararg
Fixes `MethodCanBeVariableArityMethod` inspection violations.

Description:
>Reports methods with which can be converted to be a variable arity/varargs method, available in Java 5 and newer.
This inspection only reports if the project or module is configured to use a language level of 5.0 or higher.
2015-08-29 22:32:25 -07:00
Michal Kordas 0beb5abf9a Issue #1555: Fix malformed JUnit Rule
Fixes `JUnitRule` inspection violations.

Description:
>Reports malformed @Rule/@ClassRule usages:
* Checks for any member that is annotated with @Rule but is not public.
* Checks for any member that is annotated with @ClassRule but is not public or not static.
2015-08-29 22:31:45 -07:00
Michal Kordas 8f16a480da Issue #1555: Remove usage of obsolete junit.framework.Assert
Fixes `UseOfObsoleteAssert` inspection violations.

Description:
>Reports any calls to methods from the junit.framework.Assert class. This class is obsolete and the calls can be replaced by calls to methods from the org.junit.Assert class.
2015-08-29 22:30:30 -07:00
Michal Kordas f418179fce Issue #1555: Rename method returning boolean to use question word
Fixes `BooleanMethodNameMustStartWithQuestion` inspection violations.

Description:
>Reports boolean methods whose names do not start with a question word. Boolean methods that override library methods are ignored by this inspection.
2015-08-29 22:29:43 -07:00