Showing 7,775 of 7,775 total issues
Avoid deeply nested control flow statements. Open
if (controller != null && comp.getAttribute((String) ctrlnm) == null) {
comp.setAttribute((String) ctrlnm, controller);
}
Avoid deeply nested control flow statements. Open
if (sb != null)
sb.append(cc);
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 updateSubBindingAnnotationCount
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
protected void updateSubBindingAnnotationCount(int diff) {
for (AbstractComponent node = this; node != null;) {
setSubBindingAnnotationCount(diff, node);
AbstractComponent p = (AbstractComponent) node.getParent();
- 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 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) {
Avoid deeply nested control flow statements. Open
if (cc == ',') {
sb.append(cc);
modifiedCommandPropertySb.append(modifyAttrValueIfSimplified0(nm, sb.toString().trim(), paramIndex, isNamedParam));
if (paramIndex != 0 && !isNamedParam && nm != null) { // named param and un-named parameters together
throwCommandSimplifiedErrorUsage();
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
if (langnm.substring(0, j).equals(name))
return me.getValue();
Method getComposer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static Composer getComposer(Component comp) {
if (comp != null) {
Object onm = comp.getAttribute("composerName");
if (onm instanceof String && ((String) onm).length() > 0) {
return (Composer) comp.getAttribute((String) onm);
- 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 applyAttrAnnot
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static void applyAttrAnnot(AnnotationHelper attrAnnHelper, ComponentInfo compInfo, String nm, String val,
boolean selfAllowed, org.zkoss.util.resource.Location loc) {
Method isShadowElement
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private static final boolean isShadowElement(LanguageDefinition langdef, PageDefinition pgdef, String nm,
String pref, String uri, boolean bNativeContent) {
Avoid deeply nested control flow statements. Open
for (Annotation anno : annotationMap.getAnnotations(propName)) {
compInfo.addAnnotation(propName, anno.getName(), anno.getAttributes(), anno.getLocation());
}
Method addAttribute
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private void addAttribute(ComponentInfo compInfo, Namespace attrns, String name, String value, ConditionImpl cond,
org.zkoss.xml.Locator xl) throws Exception {
Avoid deeply nested control flow statements. Open
if (nsParser.isMatched(attURI)) {
if (nsParser.parse(attr, compInfo, pgdef)) {
handled = true;
break;
}
Method checkIdSpacesDown
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static void checkIdSpacesDown(Component comp, IdSpace owner) {
final String compId = comp.getId();
if (!(comp instanceof NonFellow) && !isAutoId(compId)
&& (owner instanceof Component
? ((AbstractComponent) owner)._auxinf.spaceInfo.fellows.containsKey(compId)
- 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 (desktop != null) {
onListenerChange(desktop, false);
if (getClientEvents().containsKey(evtnm)) {
if (lis.isEmpty() && !Events.isListened(this, evtnm, false))
Method setWidgetListener
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public String setWidgetListener(String evtnm, String script) {
if (evtnm == null)
throw new IllegalArgumentException();
final String old;
- 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 service
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
/*package*/ void service(Event event, Scope scope, final List<EventListenerInfo> listeners,
final EventHandler evthd, final Method mtd, boolean skipPageListener) throws Exception {
Avoid deeply nested control flow statements. Open
if (li.priority == priority)
return false; //nothing to do
Avoid deeply nested control flow statements. Open
if (lis.isEmpty())
_auxinf.listeners.remove(evtnm);