Showing 7,775 of 7,775 total issues
Method service
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
final String cmd = request.getCommand();
if (cmd.equals(Events.ON_OPEN)) {
OpenEvent evt = OpenEvent.getOpenEvent(request);
_open = evt.isOpen();
- 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 (_open)
gmodel.addOpenGroup(gindex);
else
gmodel.removeOpenGroup(gindex);
Method close
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void close() {
if (_selected) {
final Tab tab = selectNextTab();
if (tab != null) {
final Set<Tab> selItems = new HashSet<Tab>(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 setSelectedIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void setSelectedIndex(int jsel) {
if (jsel < 0)
jsel = -1;
if (_jsel != jsel) {
if (jsel < 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
Avoid deeply nested control flow statements. Open
if (matcher.find()) {
regexFlags = matcher.group(0).trim();
}
Avoid deeply nested control flow statements. Open
if (cc == '\\')
++k; //skip one
Method show
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public static Button show(String message, String title, Button[] buttons, String icon, Button focus,
EventListener<ClickEvent> listener) {
Method setLocalized
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void setLocalized(boolean localized) {
if (_localized != localized) {
if (localized && "instant".equals(_mode))
throw new UnsupportedOperationException("localized not supported in instant mode yet");
- 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 setScale
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public void setScale(double lowerBound, double upperBound, double startAngle, double extent,
double majorTickInterval, int minorTickCount) {
Method onChildAdded
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void onChildAdded(Component child) {
super.onChildAdded(child);
if (_disabled) {
if (child instanceof Radio) {
- 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 removeAll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean removeAll(Collection<?> c) {
if (_set == c || this == c) { //special case
clear();
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
Avoid deeply nested control flow statements. Open
if (offset > 0) {
List groupsInfos = groupsListModel.getGroupsInfos();
gindex += getGroupIndex(groupsInfos, offset) + 1;
}
Method newScale
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public DialModelScale newScale(double lowerBound, double upperBound, double startAngle, double extent,
double majorTickInterval, int minorTickCount) {
Avoid deeply nested control flow statements. Open
if (cc == '/') {
hasEndingSlash = true;
break; //ending / found
}
Avoid deeply nested control flow statements. Open
if (k >= len) { //no ending /
k = -1;
break;
}
Method setPageSize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public void setPageSize(int size) throws WrongValueException {
if (size < 0) {
throw new WrongValueException("page size should >= 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 retainAll
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean retainAll(Collection<?> c) {
if (_set == c || this == c) { //special case
return false;
}
//bug #1819318 Problem while using SortedSet with Databinding
- 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 doSelectionChanged
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private void doSelectionChanged() {
final Selectable<Object> smodel = getSelectableModel();
if (smodel.isSelectionEmpty()) {
if (_jsel >= 0)
setSelectedItem(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 setVisible
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public boolean setVisible(boolean visible) {
if (isVisible() == visible)
return visible;
final boolean result = super.setVisible(visible);
- 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 getGroupsInfoAt
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
/*package*/ int[] getGroupsInfoAt(int index, boolean isGroup) {
for (Iterator<int[]> it = _groupsInfo.iterator(); it.hasNext();) {
int[] g = it.next();
if (isGroup) {
if (index == g[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"