Showing 4,841 of 7,782 total issues
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 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 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 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 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 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 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 triggerBeforeHostChildRemoved
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private void triggerBeforeHostChildRemoved(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"
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 redrawChildren
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected void redrawChildren(Writer out) throws IOException {
final Object xc = getExtraCtrl();
if (xc instanceof Cropper) {
final Set<? extends Component> crop = ((Cropper) xc).getAvailableAtClient();
if (crop != 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 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"
Further reading
Method onEvent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public void onEvent(Event event) throws Exception {
final long max = System.currentTimeMillis() + getMaxSchedTime();
if (log.isDebugEnabled()) {
log.debug("Handling schedule server push, _schedInfos is empty: [{}]", !scheduledServerPush());
}
- 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 resolveClass
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public Class resolveClass(String name) throws XelException {
if (_mappers != null) {
for (Iterator it = CollectionsX.comodifiableIterator(_mappers); it.hasNext();) {
final FunctionMapper mapper = (FunctionMapper) it.next();
if (mapper instanceof FunctionMapperExt) {
- 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 getAttributes
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static final void getAttributes(StringBuffer sb, Map<String, Object> props,
Collection<Namespace> namespaces) {
if (namespaces != null && !namespaces.isEmpty()) {
for (Namespace ns : namespaces) {
sb.append(" xmlns");
- 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"