Showing 4,841 of 7,782 total issues
Method alert
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected void alert(String m) {
if ("ajax".equals(Executions.getCurrent().getDesktop().getDeviceType())) {
//zk.jar cannot depends on zul.jar; thus we call Messagebox.show() via
//reflection.
try {
- 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 initializeProvider
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static EventQueueProvider initializeProvider() {
EventQueueProvider provider = null;
String clsnm = Library.getProperty(
"org.zkoss.zk.ui.event.EventQueueProvider.class");
if (clsnm == 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 parseInteger
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static Integer parseInteger(Element el, String subnm, int flag) throws UiException {
//Note: we throw exception rather than warning to make sure
//the developer correct it
String val = el.getElementValue(subnm, true);
if (val != null && val.length() > 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 setDynamicProperty
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public void setDynamicProperty(String name, Object value) throws WrongValueException {
if (name == null)
throw new WrongValueException("name required");
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 sendEvent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static void sendEvent(Component comp, Event event) {
final Execution exec = Executions.getCurrent();
final Desktop desktop = exec.getDesktop();
//note: we don't use comp.getDesktop because 1) it may be null
//2) it may be different from the current desktop
- 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 dispatch
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private boolean dispatch(Writer out, String page, Map params, int mode, boolean include)
throws IOException, ServletException {
//FUTURE: handle if ~./, PASS_THRU_ATTR and with query string
//In other words, we convert query string to params if
//PASS_THRU_ATTR and ~./ (to have a better performance)
- 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 setAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public Object setAttribute(String name, Object value, boolean recurse) {
if (recurse && !hasAttribute(name)) {
if (_wapp != null) {
if (_wapp.hasAttribute(name, true))
return _wapp.setAttribute(name, value, true);
- 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 removeAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public Object removeAttribute(String name, boolean recurse) {
if (recurse && !hasAttribute(name)) {
if (_wapp != null) {
if (_wapp.hasAttribute(name, true))
return _wapp.removeAttribute(name, true);
- 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 buildChildCtx
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private ComponentMatchCtx buildChildCtx(Component comp) {
_trackedUuid.add(comp.getUuid());
ComponentMatchCtx parent = _currCtx;
boolean insideShadow = false;
if (parent.getComponent() instanceof ShadowElement) {
- 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 init
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public void init(final Page page, final boolean evalHeaders) {
final PageCtrl pageCtrl = (PageCtrl) page;
pageCtrl.init(new PageConfig() {
public String getId() {
return _id;
- 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 writeObject
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
s.defaultWriteObject();
if (_compdefs != null) {
synchronized (_compdefs) {
- 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 resolveForEach
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public ForEach resolveForEach(Page page, Component comp) {
return _forEach == null ? null
: _forEachInfo.length == 2
? (comp != null
? ForEachImpl.getInstance(_evalr, comp, _forEach, _forEachInfo[0], _forEachInfo[1])
- 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 newInstance
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public Component newInstance(Page page, Component parent) {
Object impl = evalImpl(page, parent);
ComponentsCtrl.setCurrentInfo(this);
final Component comp;
try {
- 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 parseAttribute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private void parseAttribute(PageDefinition pgdef, ComponentInfo parent, Element el, AnnotationHelper annHelper)
throws Exception {
if (el.getAttributeItem("forEach") != null)
throw new UiException(message("forEach not applicable to attribute", el));
- 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 parseUpload
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public static void parseUpload(Component comp, String upload) {
if (!Strings.isEmpty(upload)) {
Map<String, String> args = new HashMap<String, String>();
Maps.parse(args, upload, ',', (char) 1);
- 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 iterator
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public Iterator<Component> iterator() {
return new Iterator<Component>() {
final Iterator<Component> _it = children.iterator();
Component _next;
- 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 binarySearchSubTree
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private Object binarySearchSubTree(HtmlShadowElement subTree, int queryIndex, Map<Component, Integer> indexMap) {
int startIndex, endIndex;
if (subTree._firstInsertion == null) {
return -1; // skip this;
} else if ((startIndex = indexMap.get(subTree._firstInsertion)) > queryIndex) {
- 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 markARing
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private void markARing(Component child, boolean set, int which) {
if (set) {
if (_aring == null)
_aring = new Set[2];
- 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 triggerBeforeHostChildAdded
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private void triggerBeforeHostChildAdded(Component child, Component insertBefore) {
if (isDisabledHostChanged()) return;
List<ShadowElement> shadowRoots = getShadowRoots();
if (!shadowRoots.isEmpty()) {
try {
- 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 checkIdSpaces
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private static void checkIdSpaces(final AbstractComponent comp, String newId) {
if (comp instanceof NonFellow)
return; //no need to check
if (comp instanceof IdSpace && comp._auxinf.spaceInfo.fellows.containsKey(newId))
- 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"