Showing 7,775 of 7,775 total issues
Avoid deeply nested control flow statements. Open
if (val == null)
continue; //don't use it in clone
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
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 (!keyWritten) {
keyWritten = true;
s.writeObject(me.getKey());
}
Avoid deeply nested control flow statements. Open
if (shadowHost.getParent() != null) {
return ((AbstractComponent) shadowHost.getParent()).getShadowVariable0(shadowHost, name,
recurse);
}
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 (ls.size() == 1)
_listeners.remove(evtnm);
else
it.remove();
Avoid deeply nested control flow statements. Open
if (add)
exec.addResponseHeader(nm, (Date) val);
else
exec.setResponseHeader(nm, (Date) val);
Method doCatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean doCatch(Throwable ex) throws Exception {
for (int j = 0; j < _cs.length; ++j)
if (_cs[j] instanceof ComposerExt && shallInvoke(_cs[j]))
if (((ComposerExt) _cs[j]).doCatch(ex))
return true; //caught (eat it)
- 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 compareTo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public int compareTo(Object o) {
final TimedValue tv = (TimedValue) o;
return _priority == tv._priority ? _timed > tv._timed ? 1 : _timed == tv._timed ? 0 : -1
: _priority > tv._priority ? -1 : 1; //higher priority, earlier (smaller)
}
- 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 (ck != null && ck.getParent() == parent) {
newsibs.add(ck);
attached[k] = null;
}
Method addRequests
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void addRequests(Collection<AuRequest> requests) {
for (AuRequest request : requests) {
try {
request.activate();
if (!isObsolete(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 newComposer
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static Composer newComposer(Page page, Object o) throws Exception {
Class cls;
if (o instanceof String) {
final String clsnm = ((String) o).trim();
if (page != 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
Avoid deeply nested control flow statements. Open
if (Events.isListened(root, Events.ON_PIGGYBACK, false)) { //asap+deferrable
Events.postEvent(new Event(Events.ON_PIGGYBACK, root));
Executions.getCurrent().setAttribute(ATTR_PIGGYBACK_POSTED, Boolean.TRUE);
}
Method desktopDestroyed
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static void desktopDestroyed(Desktop desktop) {
final Session sess = desktop.getSession();
final Execution exec = new ExecutionImpl(desktop.getWebApp().getServletContext(), null, null, desktop, null);
final DesktopCtrl desktopCtrl = (DesktopCtrl) desktop;
final Execution oldExec = desktop.getExecution();
- 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 enableServerPush
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean enableServerPush(ServerPush serverpush) {
final boolean serverPushAlreadyExists = _spush != null, enable = serverpush != null;
if (serverPushAlreadyExists != enable || serverpush != _spush) {
if (serverPushAlreadyExists)
enableServerPush(false, 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 doBeforeCompose
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public ComponentInfo doBeforeCompose(Page page, Component parent, ComponentInfo compInfo) throws Exception {
for (int j = 0; j < _cs.length; ++j)
if (_cs[j] instanceof ComposerExt && shallInvoke(_cs[j])) {
compInfo = ((ComposerExt) _cs[j]).doBeforeCompose(page, parent, compInfo);
if (compInfo == 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 createComponentsDirectly0
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private Component createComponentsDirectly0(Reader reader, String ext, Component parent, Component insertBefore,
VariableResolver resolver, Map<?, ?> arg) throws IOException {
Method ceaseSuspendedThread
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean ceaseSuspendedThread(Desktop desktop, EventProcessingThread evtthd, String cause) {
final Map<Object, List<EventProcessingThreadImpl>> map;
synchronized (_suspended) {
map = _suspended.get(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 createComponentsDirectly0
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private Component createComponentsDirectly0(String content, String ext, Component parent, Component insertBefore,
VariableResolver resolver, Map<?, ?> arg) {