Showing 4,841 of 7,782 total issues
Method addMessages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void addMessages(Component comp, String attr, String key, String[] messages, Object value) {
List<Message> compMsgs = _compMsgsMap.get(comp);
if (compMsgs == null) {
_compMsgsMap.put(comp, compMsgs = new ArrayList<Message>());
}
- 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 initDataListener
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void initDataListener() {
if (_dataListener == null)
_dataListener = new ListDataListener() {
public void onChange(ListDataEvent event) {
// ZK-1864: share listmodelist cause un-predictable reload
- 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 getAllTrackerNodes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected Collection<TrackerNode> getAllTrackerNodes() {
Set<TrackerNode> all = null;
final Collection<Map<Object, TrackerNode>> nodesMaps = _compMap.values();
if (nodesMaps != null && !nodesMaps.isEmpty()) {
all = new LinkedHashSet<TrackerNode>();
- 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 getDependents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private Set<TrackerNode> getDependents(Set<TrackerNode> parentnodes, String prop) {
final Set<TrackerNode> kidnodes = new LinkedHashSet<TrackerNode>();
for (TrackerNode node : parentnodes) {
for (TrackerNode kid : node.getDependents(prop)) {
if (kid != 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 getTypeName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("rawtypes")
static String getTypeName(Class type) {
if (type.isArray()) {
try {
Class cl = type;
- 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 clone
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("rawtypes")
public Object clone() {
final Selectbox clone = (Selectbox) super.clone();
if (clone._model != null) {
if (clone._model instanceof ComponentCloneListener) {
- 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 removeTrackings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void removeTrackings(Set<Component> comps) {
final Set<TrackerNode> removed = new LinkedHashSet<TrackerNode>();
for (Component comp : comps) {
final Map<Object, TrackerNode> nodesMap = _compMap.remove(comp);
if (nodesMap != 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 handleComponentAttached
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected void handleComponentAttached(Component comp) {
//ZK-2022, check if this component is in queue for removal
//if yes, then post and do processing later
boolean removeMark = Boolean.TRUE.equals(comp.getAttribute(REMOVE_MARK));
if (removeMark) {
- 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 onPageDetached
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void onPageDetached(Page page) {
super.onPageDetached(page);
if (_model != null && _dataListener != null)
_model.removeListDataListener(_dataListener);
if (_model instanceof PageableModel && _pgListener != 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 getPath0
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private int[] getPath0(Treechildren parent, int index) {
List<Integer> path = new LinkedList<Integer>();
path.add(index);
Component p = parent;
while (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 shallVisitTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static boolean shallVisitTree(Tree tree, Component child) {
final Treeitem item = (Treeitem) child;
int count = item.isOpen() && item.getTreechildren() != null ? item.getTreechildren().getVisibleItemCount() : 0;
Integer visited = (Integer) tree.getAttribute(Attributes.VISITED_ITEM_COUNT);
final Paginal pgi = tree.getPaginal();
- 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 renderTree
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void renderTree() {
if (_treechildren == null) {
Treechildren children = new Treechildren();
children.setParent(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 renderProperties
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
super.renderProperties(renderer);
if (_title.length() > 0)
render(renderer, "title", _title);
- 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 setParent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void setParent(Component parent) {
final Component oldp = getParent();
if (oldp == parent)
return; //nothing changed
- 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 onChildRemoved
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void onChildRemoved(Component child) {
if (child instanceof Treecols) {
_treecols = null;
} else if (child instanceof Treefoot) {
_treefoot = 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 onPageAttached
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public void onPageAttached(Page newpage, Page oldpage) {
super.onPageAttached(newpage, oldpage);
if (oldpage == null) {
//prepare a right moment to init Tree(must be as early as possible)
this.addEventListener("onInitModel", _modelInitListener = new ModelInitListener());
- 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 fixSelectedSet
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private void fixSelectedSet() {
_sel = null;
_selItems.clear();
for (Treeitem item : getItems()) {
if (item.isSelected()) {
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("unchecked")
private void render(Treeitem item, Object node, int index) throws Throwable {
if (!_rendered && (_renderer instanceof RendererCtrl)) {
((RendererCtrl) _renderer).doTry();
_ctrled = 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 clone
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("rawtypes")
public Object clone() {
final Combobox clone = (Combobox) super.clone();
clone._selItem = null;
clone.schedSyncValueToSelection();
- 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 fixSelected
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private boolean fixSelected() {
Treeitem sel = null;
switch (_selItems.size()) {
case 1:
sel = _selItems.iterator().next();
- 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"