Showing 4,841 of 7,782 total issues
Method service
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void service(Event event, Scope scope) throws Exception {
if (event instanceof StubEvent) {
EventListenerMap map = ((ComponentCtrl) this).getEventListenerMap();
if (map != null) {
map.service(event, scope, this, ((StubEvent) event).getCommand());
- 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 parseComposite
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static Object parseComposite(String expr, Class expcls, int type) {
if (expr == null)
return null;
if (type == LIST) {
- 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 onChanging$searchBox
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void onChanging$searchBox(InputEvent event) {
String key = event.getValue();
LinkedList<DemoItem> item = new LinkedList<DemoItem>();
DemoItem[] items = getItems();
- 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 isSubscribed
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public boolean isSubscribed(EventListener<T> listener) {
if (listener != null)
for (ListenerInfo<T> li : _listenerInfos)
if (listener.equals(li.listener))
return 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 addDataHandler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void addDataHandler(DataHandlerInfo info) {
final String name = info.getName();
DataHandlerInfo old = _dataHandlers.put(name, info);
if (info.isOverride()) {
if (old == 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 invokeExecutionCleanups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void invokeExecutionCleanups(Execution exec, Execution parent, List<Throwable> errs) {
final Class<?>[] ary = _execCleans.toArray();
for (int j = 0; j < ary.length; ++j) {
try {
((ExecutionCleanup) ary[j].newInstance()).cleanup(exec, parent, errs);
- 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 parseLangConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void parseLangConfig(Locator locator, Element conf) {
for (Iterator it = conf.getElements("addon-uri").iterator(); it.hasNext();) {
final Element el = (Element) it.next();
final String path = el.getText(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 str
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void str(StringBuilder sb, boolean[][] arr) {
if (arr.length > 1)
sb.append('[');
for (int i = 0; i < arr.length; i++) {
if (i > 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 processDynamicWpdWithSourceMapIfAny
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private byte[] processDynamicWpdWithSourceMapIfAny(HttpServletRequest request, HttpServletResponse response, String pkgWpd, String path) throws Exception {
List<String> dividedPaths = splitSourceMapJsPathIfAny(path);
StringBuilder sb = new StringBuilder();
int index = 0;
String lastWpd = 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 guessImplicitObjectName
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static String guessImplicitObjectName(Class<?> cls) {
if (Execution.class.equals(cls))
return "execution";
if (Page.class.equals(cls))
return "page";
- 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 isDescendant
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static boolean isDescendant(Component c1, Component c2) {
if (c1 == c2)
return true; // first c1 can be IdSpace
while ((c1 = c1.getParent()) != null) {
if (c1 == c2)
- 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 getTimeZone
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static TimeZone getTimeZone(HttpSession hsess) {
TimeZone tz = checkTimeZone(hsess.getAttribute(Attributes.PREFERRED_TIME_ZONE));
if (tz != null)
return tz;
- 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 lookingForShadow
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static boolean lookingForShadow(List<Selector> list) {
for (Selector s : list) {
for (SimpleSelectorSequence seq : s) {
if (!seq.getPseudoElements().isEmpty()) {
return 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 matchValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static boolean matchValue(Object value, Attribute attr) {
switch (attr.getOperator()) {
case BEGIN_WITH:
return value != null && value.toString().startsWith(attr.getValue());
case END_WITH:
- 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 addActivationListener
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final void addActivationListener(ServletContext ctx, WebManagerActivationListener listener) {
if (ctx == null || listener == null)
throw new IllegalArgumentException("null");
final WebManager webman = getWebManagerIfAny(ctx);
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public static boolean match(Component component, String selector, Map<String, PseudoClassDef> defs) {
List<Selector> selectorList = new Parser().parse(selector);
ComponentMatchCtx ctx = new ComponentMatchCtx(component, selectorList);
for (Selector s : selectorList) {
if (s.size() > 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 buildNextCtx
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private ComponentMatchCtx buildNextCtx() {
if (_allIds)
return null;
// TODO: how to skip tree branches
- 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 getLandingState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected State getLandingState(Character input, CharClass inputClass) {
if (input == '[')
return State.IN_ATTRIBUTE;
- 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 getCWRURLPrefix
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private String getCWRURLPrefix() {
final String verInfoEnabled = Library.getProperty("org.zkoss.zk.ui.versionInfo.enabled", "true");
String build = _wapp.getBuild();
if (!"true".equals(verInfoEnabled)) {
return org.zkoss.zk.ui.http.Utils.obfuscateHashWithSalt(build, verInfoEnabled);
- 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 initializeRenderPatch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static PageRenderPatch initializeRenderPatch() {
final String clsnm = Library.getProperty(org.zkoss.zk.ui.sys.Attributes.PORTLET_RENDER_PATCH_CLASS);
if (clsnm == null) {
return new PageRenderPatch() {
public Writer beforeRender(RequestInfo reqInfo) {
- 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"