Showing 4,841 of 7,782 total issues
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 (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 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 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
if (langnm.substring(0, j).equals(name))
return me.getValue();
Avoid deeply nested control flow statements. Open
if (nsParser.isMatched(attURI)) {
if (nsParser.parse(attr, compInfo, pgdef)) {
handled = true;
break;
}
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) {
Avoid deeply nested control flow statements. Open
if (tis.isEmpty()) { //no more event
_auxinf.forwards.remove(orgEvent);
removeEventListener(orgEvent, info.listener);
}
Avoid deeply nested control flow statements. Open
if (val == null)
continue; //don't use it in clone
Avoid deeply nested control flow statements. Open
if (shadowHost.getParent() != null) {
return ((AbstractComponent) shadowHost.getParent()).getShadowVariable0(shadowHost, name,
recurse);
}
Method setMold
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void setMold(String mold) {
if (mold != null && (DEFAULT.equals(mold) || mold.length() == 0))
mold = null;
if (!Objects.equals(_auxinf != null ? _auxinf.mold : DEFAULT, mold)) {
if (!_def.hasMold(mold != null ? mold : DEFAULT))
- 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 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
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 (lis.isEmpty())
_auxinf.listeners.remove(evtnm);
Method setWidgetOverride
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public String setWidgetOverride(String name, String script) {
if (name == 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
Avoid deeply nested control flow statements. Open
if (li.priority == priority)
return false; //nothing to do
Avoid deeply nested control flow statements. Open
if (!keyWritten) {
keyWritten = true;
s.writeObject(me.getKey());
}