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 {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/ServerPush.java - About 25 mins to fix

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);

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");
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/B0004.java - About 25 mins to fix

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++) {

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()) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/CometServerPush.java - About 25 mins to fix

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();
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/bind/issue/B0004.java - About 25 mins to fix

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++) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/F85_ZK_3808VM.java - About 25 mins to fix

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;
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B70_ZK_2764_3.java - About 25 mins to fix

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) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1766_Composer.java - About 25 mins to fix

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());

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;

Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4248VM.java - About 25 mins to fix

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()) {
Severity: Minor
Found in zksandbox/src/main/java/org/zkoss/zksandbox/CometServerPush.java - About 25 mins to fix

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++) {
Severity: Minor
Found in zksandbox/src/main/java/org/zkoss/zksandbox/MainLayoutComposer.java - About 25 mins to fix

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;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/xel/impl/SimpleEvaluator.java - About 25 mins to fix

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*/;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlMacroComponent.java - About 25 mins to fix

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;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlMacroComponent.java - About 25 mins to fix

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;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.java - About 25 mins to fix

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++) {
Severity: Minor
Found in zksandbox/src/main/java/org/zkoss/zksandbox/ModelProvider.java - About 25 mins to fix

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++) {
Severity: Minor
Found in zksandbox/src/main/java/org/zkoss/zksandbox/ModelProvider.java - About 25 mins to fix

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;
Severity: Minor
Found in zksandbox/src/main/java/org/zkoss/zksandbox/MainLayoutComposer.java - About 25 mins to fix

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

Severity
Category
Status
Source
Language