Showing 4,841 of 7,782 total issues
Avoid deeply nested control flow statements. Open
if (sb != null)
sb.append(cc);
Avoid deeply nested control flow statements. Open
if (!bRichlet) {
path = prefs.getValue(ATTR_RICHLET, null);
bRichlet = path != null;
if (!bRichlet)
path = _defpage;
Avoid deeply nested control flow statements. Open
if (Interpreters.exists(zslang)) {
content = content.substring(j + 1);
break;
} else {
log.warn("Ignored: unknown scripting language, " + zslang);
Avoid deeply nested control flow statements. Open
if (controller != null && comp.getAttribute((String) ctrlnm) == null) {
comp.setAttribute((String) ctrlnm, controller);
}
Method writeObject
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject();
final LanguageDefinition langdef = _compdef.getLanguageDefinition();
if (langdef != 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 findAssignable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static Method findAssignable(final Method[] mtds, final Object val) {
if (val != null) {
//Look for the most 'extended' and isInstance class
Method m = null;
Class<?> t = 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 beforeService
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static Desktop beforeService(DesktopRecycle dtrc, ServletContext ctx, Session sess,
HttpServletRequest request, HttpServletResponse response, String path) {
Avoid deeply nested control flow statements. Open
if (j < len && val.charAt(j) == '(')
return true;
Avoid deeply nested control flow statements. Open
if (ai._loc == null)
ai._loc = an.getLocation();
Method resolve
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private Object[] resolve(Class cls) {
Method mtd = null;
Method[] mtds = null;
final String mtdnm = Classes.toMethodName(_name, "set");
if (_value == 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 newMacroDefinition
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static final ComponentDefinition newMacroDefinition(LanguageDefinition langdef, PageDefinition pgdef,
String name, Class<? extends Component> cls, String macroURI, boolean inline) {
Method parseItem
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private Object parseItem(PageDefinition pgdef, NodeInfo parent, Element el, AnnotationHelper annHelper,
boolean bNativeContent, ParsingState parsingState) throws Exception {
Method newInstance
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
/*package*/ Object newInstance(Class<?> cls, Evaluator eval, Page page) throws Exception {
if (_args != null) {
Map<String, Object> args = resolveArguments(eval, page);
try {
return cls.getConstructor(new Class[] { Map.class }).newInstance(new Object[] { args });
- 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 (j > 0)
sb.append(value.substring(0, j));
Method getLocator
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static final Locator getLocator(WebApp wapp, String path) {
if (wapp == null)
throw new IllegalArgumentException("null");
if (path != null && path.length() > 0 && path.charAt(0) == '/') {
- 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 findNullable
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static Method findNullable(final Method[] mtds, final Object val) {
if (val == null) {
//Look for the most 'extended' class
Method m = null;
Class<?> t = 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 getValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public Object getValue(PageDefinition pgdef, Page page) {
final Evaluator eval = pgdef.getEvaluator();
if (_cond == null || _cond.isEffective(eval, page)) {
final Object val = _value.getValue(eval, page);
return val != null ? val instanceof Date ? val : val.toString() : "";
- 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 parseAsProperty
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private void parseAsProperty(PageDefinition pgdef, ComponentInfo compInfo, String name, Collection items,
AnnotationHelper annHelper, ConditionImpl cond) throws Exception {
Avoid deeply nested control flow statements. Open
for (Annotation anno : annotationMap.getAnnotations(propName)) {
compInfo.addAnnotation(propName, anno.getName(), anno.getAttributes(), anno.getLocation());
}
Method applyAttrAnnot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void applyAttrAnnot(AnnotationHelper attrAnnHelper, ShadowInfo compInfo, String nm, String val,
boolean selfAllowed, org.zkoss.util.resource.Location loc) {