Showing 4,841 of 7,782 total issues
Method beforeChildAdded
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void beforeChildAdded(Component child, Component refChild) {
if (child instanceof Treerow) {
if (_treerow != null && _treerow != child)
throw new UiException("Only one treerow is allowed: " + this);
} else if (child instanceof Treechildren) {
- 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 afterUnmarshal
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void afterUnmarshal(int cnt) {
for (Iterator it = getChildren().iterator(); it.hasNext();) {
final Object child = it.next();
if (child instanceof Treerow) {
_treerow = (Treerow) child;
- 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 setLabel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void setLabel(String label) {
final String old = getLabel();
if (!Objects.equals(old, label)) {
final Combobox cb = (Combobox) getParent();
final boolean syncValueToSelection = cb != null && cb.getSelectedItemDirectly() == 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 autoFirstCell
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private Label autoFirstCell() {
Component cell = getFirstChild();
if (cell == null || cell instanceof Label || cell instanceof Cell) {
if (cell == null)
cell = new Label();
- 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 addAll
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public boolean addAll(Collection<? extends E> c) {
if (_set instanceof LinkedHashSet) {
int begin = _set.size();
int added = 0;
for (final Iterator<? extends E> it = c.iterator(); it.hasNext();) {
- 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 listIterator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public ListIterator<E> listIterator(final int index) {
return new ListIterator<E>() {
private ListIterator<E> _it = _list.listIterator(index);
private E _current = 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 setMode
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void setMode(String mode) throws WrongValueException {
if (!_mode.equals(mode)) {
if (!"auto".equals(mode) && !"instant".equals(mode) && !"defer".equals(mode))
throw new WrongValueException("Unknown mode: " + mode);
if ((_localized || _progressing) && "instant".equals(mode))
- 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 init
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void init() {
_items = new AbstractList<Row>() {
public int size() {
return getItemCount();
}
- 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 setActivePage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void setActivePage(int pg) throws WrongValueException {
if (pg < 0) {
throw new WrongValueException("expecting positive non zero value, got: " + pg);
}
if (pg > 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 doSort
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
/*package*/ boolean doSort(boolean ascending) {
final Comparator cmpr = ascending ? _sortAsc : _sortDsc;
if (cmpr == null)
return false;
- 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 beforeChildAdded
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void beforeChildAdded(Component child, Component refChild) {
if (!(child instanceof Row))
throw new UiException("Unsupported child for rows: " + child);
if (child instanceof Groupfoot) {
if (!hasGroup())
- 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 getVisibleItemCount
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public int getVisibleItemCount() {
int count = getItemCount();
int visibleCount = 0;
if (getNextSibling() instanceof Listitem) {
Listitem item = (Listitem) getNextSibling();
- 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 setModel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void setModel(ListModel<?> model) {
if (disableFeature())
throw new IllegalAccessError("ZK EE version only!");
if (model != null) {
if (!(model instanceof Selectable))
- 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 setOrient
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void setOrient(String orient) throws WrongValueException {
if (!"horizontal".equals(orient) && !"top".equals(orient) && !"bottom".equals(orient)
&& !"vertical".equals(orient) && !"right".equals(orient) && !"left".equals(orient))
throw new WrongValueException("Unknow orient : " + orient);
if (inAccordionMold())
- 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 beforeChildAdded
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void beforeChildAdded(Component child, Component refChild) {
if (child instanceof Caption) {
if (_caption != null && _caption != child)
throw new UiException("Only one caption is allowed: " + this);
} else {
- 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 formatNumber
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected String formatNumber(Object value, String defaultFormat) {
if (value == null)
return "";
final DecimalFormat df = (DecimalFormat) NumberFormat.getInstance(getDefaultLocale());
- 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 afterUnmarshal
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private void afterUnmarshal(int index) {
for (Iterator<Component> it = getChildren().iterator(); it.hasNext();) {
final Object child = it.next();
if (child instanceof Listitem) {
final Listitem li = (Listitem) child;
- 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 handleFunction
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private Object handleFunction(Object c, String func) {
if ("UPPER".equals(func)) {
if (c instanceof String)
return ((String) c).toUpperCase();
if (c instanceof Character)
- 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 onPageAttached
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public void onPageAttached(Page newpage, Page oldpage) {
super.onPageAttached(newpage, oldpage);
if (oldpage == null) { // mark as a new attached Listbox
final Execution exec = Executions.getCurrent();
exec.setAttribute("zkoss.Listbox.deferInitModel_" + getUuid(), Boolean.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 stringToArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static final String[] stringToArray(String src, String defaultValue) {
if (src == null)
return null;
List<String> list = new LinkedList<String>();
- 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"