Showing 4,841 of 7,782 total issues
Method run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void run() {
try {
while (_desktop.getAttribute("sp.ceased") == null) {
Executions.activate(_desktop);
try {
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
public void render(Treeitem treeitem, Object data, int index) throws Exception {
Treerow row;
if(treeitem.getTreerow()==null){// tree row not create yet.
row = new Treerow();
row.setParent(treeitem);
- 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 getValidator3
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Validator getValidator3(){
return new Validator(){
public void validate(ValidationContext ctx) {
if(!ctx.isValid()) return;
Object val1 = ctx.getProperties().get("value1")[0].getValue();//ctx.getPropertyValue("value1");
- 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 getItems
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static Object[][] getItems () {
Object[][] items = new Object[itemCnt][3];
int setCnt = -1;
String setStr = "";
for (int i = 0; i < itemCnt; i++) {
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void run() {
try {
while (true) {
if (_info.getDesktop() == null
|| !_desktop.isServerPushEnabled()) {
- 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 getValidator1
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Validator getValidator1(){
return new Validator(){
public void validate(ValidationContext ctx) {
if(!ctx.isValid()) return;
Property p = ctx.getProperty();
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
@Init
public void init() {
for (int i = 0; i < 8; i++) {
headers.add("Header " + i);
for (int j = 0; j < 2; 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 updateRandomNodes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Listen("onClick = #updateButtonRandom")
public void updateRandomNodes() {
Random random = new Random();
for(int i = 0; i < 10; i++) {
TreeNode<String> randomNode = 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 updateAll
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@Listen("onClick = #updateAll")
public void updateAll() {
DefaultTreeNode<TestObject> root = (DefaultTreeNode<TestObject>) treeModel.getRoot();
List<TreeNode<TestObject>> children = root.getChildren();
for (TreeNode<TestObject> treeNode : children) {
- 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 getValidator
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Validator getValidator() {
return new AbstractValidator() {
public void validate(ValidationContext ctx) {
Map<String, Property> formProps = ctx.getProperties(ctx.getProperty().getValue());
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
@Init
public void init(){
int cols = 5;
int rows = 2000;
- 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 run
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void run() {
try {
while (true) {
if (_info.getDesktop() == null
|| !_desktop.isServerPushEnabled()) {
- 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 onBookmarkChange$main
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void onBookmarkChange$main(BookmarkEvent event) {
String id = event.getBookmark();
if (id.length() > 0) {
final DemoItem[] items = getItems();
for (int i = 0; i < items.length; i++) {
- 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 newXelContext
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected XelContext newXelContext(Object ref) {
final FunctionMapper mapper = getFunctionMapper(ref);
final VariableResolver resolver = getVariableResolver(ref);
SimpleXelContext context = new SimpleXelContext(resolver, mapper);
Page 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
Method getAutowireFlag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static int getAutowireFlag() {
if (_autowireflag == null)
_autowireflag = "true".equals(Library.getProperty("org.zkoss.zk.ui.macro.autowire.disabled")) ? -1
/*no wire*/ : "true".equals(Library.getProperty("org.zkoss.zk.ui.macro.autowire.convention")) ? 1
/*convention*/ : 0/*selector*/;
- 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 setMacroURI
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void setMacroURI(String uri) {
if (!Objects.equals(_uri, uri)) {
if (uri != null && uri.length() == 0)
throw new IllegalArgumentException("empty");
_uri = uri;
- 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 getEventMethod
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static final Method getEventMethod(Class<?> cls, String evtnm) {
final Pair<Class<?>, String> key = new Pair<Class<?>, String>(cls, evtnm);
final Object o = _evtmtds.get(key);
if (o != null)
return o == Objects.UNKNOWN ? null : (Method) o;
- 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 getArrayDefaultTreeModel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static DefaultTreeModel getArrayDefaultTreeModel(int level1, int level2, int level3, String label) {
Random rand = new Random(new Random().nextLong());
Calendar cal = Calendar.getInstance();
List list = new ArrayList(level1);
for (int i = 0; i < level1; i++) {
- 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 getBeanDefaultTreeModel
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static DefaultTreeModel getBeanDefaultTreeModel(int level1, int level2, int level3, String label) {
Random rand = new Random(new Random().nextLong());
Calendar cal = Calendar.getInstance();
List list = new ArrayList(level1);
for (int i = 0; i < level1; i++) {
- 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 onCategorySelect
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public void onCategorySelect(ForwardEvent event) {
Button btn = (Button) event.getOrigin().getTarget();
Listitem item = null;
if (_selected != btn) {
_selected = btn;
- 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"