Showing 7,775 of 7,775 total issues
Method setNamespace
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public final void setNamespace(Namespace ns) {
if (ns == null) {
if (_ns != null && _ns.getPrefix().length() == 0)
return; //nothing to do
ns = getNamespace("");
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method nextToken
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static final Result nextToken(String src, int from,
char[] separators, boolean escBackslash, boolean quotAsToken,
boolean parenthesis)
Method escapeJavaScript
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static void escapeJavaScript(final char[] text, final int offset, final int len, final Writer writer,
final JavaScriptEscapeType type, final JavaScriptEscapeLevel level)
Method writeObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private synchronized void writeObject(ObjectOutputStream s)
throws IOException {
s.defaultWriteObject();
if (_m == null) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method joinAndInterrupt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static final void joinAndInterrupt(Thread thd, int timeout)
throws InterruptedException {
if (timeout == 0)
timeout = Integer.MAX_VALUE;
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method escapeJavaScript
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static void escapeJavaScript(final char[] text, final int offset, final int len, final Writer writer,
final JavaScriptEscapeType type, final JavaScriptEscapeLevel level)
throws IOException {
if (writer == null) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method match
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static
Method match(Class<?> cls, String name, Object[] args, boolean loosely) {
final Method[] ms = cls.getMethods();
for (int j = 0; j < ms.length; ++j) {
if (!ms[j].getName().equals(name)
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method nextSeparator
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static int nextSeparator(String src, int from, char[] separators,
boolean escBackslash, boolean escQuot, boolean quotAsSeparator) {
Avoid deeply nested control flow statements. Open
if ((f - (i + 2)) < 2) {
// We weren't able to consume the required two hexa chars, leave it as slash+'x', which
// is invalid, and let the corresponding JavaScript engine fail.
i++;
continue;
Avoid deeply nested control flow statements. Open
if ((f - (i + 2)) < 2) {
// We weren't able to consume the required two hexa chars, leave it as slash+'x', which
// is invalid, and let the corresponding JavaScript engine fail.
i++;
continue;
Method importClass
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void importClass(String name) throws org.zkoss.zel.ELException {
if (!name.contains(".")) {
throw new ELException(Util.message(
null, "importHandler.invalidClassName", name));
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
while (f < (i + 4) && f < max) {
final char cf = text.charAt(f);
if (!((cf >= '0' && cf <= '9') || (cf >= 'A' && cf <= 'F') || (cf >= 'a' && cf <= 'f'))) {
break;
}
Method escape
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
static void escape(final char[] text, final int offset, final int len, final Writer writer,
final JavaScriptEscapeType escapeType, final JavaScriptEscapeLevel escapeLevel)
Avoid deeply nested control flow statements. Open
while (f < (i + 4) && f < max) {
final char cf = text[f];
if (!((cf >= '0' && cf <= '9') || (cf >= 'A' && cf <= 'F') || (cf >= 'a' && cf <= 'f'))) {
break;
}
Method setValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void setValue(ELContext context, Object base, Object property,
Object value) {
if (context == null) {
throw new NullPointerException();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (kind > 56)
kind = 56;
Avoid deeply nested control flow statements. Open
if (kind > 57)
kind = 57;
Avoid deeply nested control flow statements. Open
if (kind > 10)
kind = 10;
Method forName
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static Class<?> forName(String name) throws ClassNotFoundException {
if (null == name || "".equals(name)) {
return null;
}
Class<?> c = forNamePrimitive(name);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Avoid deeply nested control flow statements. Open
if (kind > 1)
kind = 1;