Showing 7,775 of 7,775 total issues
Method initKey
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void initKey() {
// We have to decide the key of Google Maps since we have a demo using
// it.
// This key is used by zksandbox/index.zul to generate a proper
// script
- 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 outDivTemplateEnd
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static void outDivTemplateEnd(Page page, Writer out) throws IOException {
final Desktop dt;
if (page != null && (dt = page.getDesktop()) != null) {
if (dt.getAttribute(ATTR_DESKTOP_CLIENTINFO) != null) {
dt.removeAttribute(ATTR_DESKTOP_CLIENTINFO);
- 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 newEventThreadCleanups
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public List<EventThreadCleanup> newEventThreadCleanups(Component comp, Event evt, List<Throwable> errs,
boolean silent) {
final Class<?>[] ary = _evtCleans.toArray();
if (ary.length == 0)
return 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 run
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void run() {
try {
_inf.listener.onEvent(_event);
if (_inf.callback != null || _pendingEvents != 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 invokeEventThreadCompletes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void invokeEventThreadCompletes(List<EventThreadCleanup> cleanups, Component comp, Event evt,
List<Throwable> errs, boolean silent) {
if (cleanups == null || cleanups.isEmpty())
return;
- 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 buildChildCtxWithShadowOrComponent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private ComponentMatchCtx buildChildCtxWithShadowOrComponent(Component comp, HtmlShadowElement htmlShadowElement, boolean isFirstShadow) {
if (comp != null && htmlShadowElement != null) {
try {
switch (HtmlShadowElement.inRange(htmlShadowElement, comp)) {
case PREVIOUS:
- 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 newVariableResolvers
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static List<VariableResolver> newVariableResolvers(Class<?> cls, Class<?> untilClass) {
final List<VariableResolver> resolvers = new ArrayList<VariableResolver>();
while (cls != null && cls != untilClass) {
final org.zkoss.zk.ui.select.annotation.VariableResolver anno = cls
.getAnnotation(org.zkoss.zk.ui.select.annotation.VariableResolver.class);
- 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 invoke
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
/*package*/ String invoke(RequestContext reqctx, MethodInfo mi) {
final Class[] argTypes = mi.method.getParameterTypes();
final Object[] args = mi.arguments.clone(); // ZK-4312: leaking request/response into wpd cache
if (reqctx != null) {
for (int j = 0; j < args.length; ++j)
- 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 parse
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private WcsInfo parse(InputStream is, String path) throws Exception {
final Element root = new SAXBuilder(true, false, true).build(is).getRootElement();
final String lang = IDOMs.getRequiredAttributeValue(root, "language");
if (lang.length() == 0)
throw new UiException("The language attribute must be specified, " + root.getLocator() + ", " + path);
- 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 addSclass
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void addSclass(String cssClass) {
if (!Strings.isEmpty(cssClass)) {
String sclass = getSclass();
if (sclass == null) {
setSclass(cssClass);
- 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 getContent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public String getContent(Page page, Component comp) {
if (_cnt != null)
return _cnt;
final URL url;
- 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 a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void service(AuRequest request, boolean everError) {
final String cmd = request.getCommand();
if (cmd.equals(Events.ON_CLICK) || cmd.equals(Events.ON_DOUBLE_CLICK) || cmd.equals(Events.ON_RIGHT_CLICK)
|| cmd.equals(Events.ON_MOUSE_OVER) || cmd.equals(Events.ON_MOUSE_OUT)) {
Events.postEvent(MouseEvent.getMouseEvent(request));
- 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 get
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public EventHandler get(Component comp, String evtnm) {
if (_evthds != null) {
final List<EventHandler> ehl = _evthds.get(evtnm);
if (ehl != null)
for (EventHandler eh : ehl)
- 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 add
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void add(String evtnm, EventHandler evthd) {
if (evtnm == null || evthd == null)
throw new IllegalArgumentException("null");
if (_evthds == 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 getPreviousInsertionComponentIfAny
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public Component getPreviousInsertionComponentIfAny() {
if (_previousInsertion == null) {
Component result = _firstInsertion == null ? null : _firstInsertion.getNextSibling();
if (result == null && getParent() != null) // ask for its parent
return asShadow(getParent()).getPreviousInsertionComponentIfAny();
- 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 getNextInsertionComponentIfAny
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public Component getNextInsertionComponentIfAny() {
if (_nextInsertion == null) {
Component result = _lastInsertion == null ? null : _lastInsertion.getNextSibling();
if (result == null && getParent() != null) { // ask for its parent
return asShadow(getParent()).getNextInsertionComponentIfAny();
- 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 getLanguageDefinition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private static final LanguageDefinition getLanguageDefinition(NodeInfo node) {
for (; node != null; node = node.getParent()) {
if (node instanceof ComponentInfo) {
LanguageDefinition langdef = ((ComponentInfo) node).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 setDeviceType
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void setDeviceType(String deviceType) {
//Note: we check _comps.isEmpty() only if device type differs, because
//a desktop might have several richlet and each of them will call
//this method once
if (!_devType.equals(deviceType)) {
- 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 triggerBeforeHostParentChanged
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void triggerBeforeHostParentChanged(Component parent) {
if (isDisabledHostChanged()) return;
List<ShadowElement> shadowRoots = getShadowRoots();
if (!shadowRoots.isEmpty()) {
Map<Component, Integer> indexCacheMap = getIndexCacheMap(this);
- 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 triggerAfterHostChildAdded
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void triggerAfterHostChildAdded(Component child) {
if (isDisabledHostChanged()) return;
List<ShadowElement> shadowRoots = getShadowRoots();
if (!shadowRoots.isEmpty()) {
Map<Component, Integer> indexCacheMap = getIndexCacheMap(this);
- 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"