A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/pmd/pmd/issues/2181 below:

False positive with indexed array access · Issue #2181 · pmd/pmd · GitHub

#2160 (comment)
Affects PMD Version:
6.20.0

Rule:
LawOfDemeter

Description:
Index of array is treated as a method chain call by this rule. Data structures must be exempt from this rule especially indexed array access.

Code Sample demonstrating the issue:

public final class Util {  
  
  public static boolean check(String passwd,
                              String hashed) {
    try {
      final String[] parts = hashed.split("\\$");

      if (parts.length != 5 || !parts[1].equals("s0")) {
        throw new IllegalArgumentException(
            "Invalid hashed value");
      }
    }
  }

  
}

Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4