Showing 4,841 of 7,782 total issues

Method isReadOnly has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean isReadOnly(ELContext context, Object base, Object property) {

        if (context == null) {
            throw new NullPointerException();
        }
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/BeanNameELResolver.java - About 35 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 handleCompress has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected void handleCompress(HttpServletRequest request, ServletResponse response, String replacedContent) throws IOException {
        if(compress) {
            // Do gzip after CSP rewriting
            byte[] data = replacedContent.getBytes(response.getCharacterEncoding());
            if (data.length > 200) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/util/ZkCspFilterStrictDynamic.java - About 35 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 equals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)

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 tabsContains has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    protected TabInfo tabsContains(ListModelList<TabInfo> tabInfos, String id) {
        if (tabInfos != null && id != null) {
            for (TabInfo tab : tabInfos) {
                if (id.equals(tab.getId())) {
                    return tab;
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B90_ZK_4344Tab2VM.java - About 35 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 onEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void onEvent(Event event) throws Exception {
        if(((OpenEvent)event).isOpen()){
            List hostitems = treeitem.getParent().getChildren();// find all host node.
            int size = hostitems.size();
            for(int i=0;i<size;i++){
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/tree/HostOpenCtrl.java - About 35 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 doActive has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @Command
    @NotifyChange("selectedItems")
    public void doActive(@BindingParam("item") Item item) {
        if (multiple) {
            item.setActive(!item.isActive());

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 clearTreeNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private  void clearTreeNode(BugOasiTreeNode<BugFormModel> node) {
        if (node == null)
            return;
        if (!node.isLeaf() && node.isOpen())
            ((DefaultTreeModel<BugFormModel>) treeNodes).removeOpenObject(node);

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 getItemRenderer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public ListitemRenderer<Object> getItemRenderer() {

        return new ListitemRenderer<Object>() {
            @Override
            public void render(Listitem listitem, Object obj, int index) {

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 onMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @OnMessage
    public void onMessage(String message, Session session) {
        Storage storage = ZKWebSocket.getDesktopStorage(session);
        if (storage == null) return;
        if ("receive".equals(message)) {
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B95_ZK_4655Endpoint.java - About 35 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 setLeaf has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private  void setLeaf(BugOasiTreeNode<BugFormModel> node) {
        if (node == null)
            return;
        if (node.getChildren() != null && node.getChildren().size()>0 ) {
            int n = node.getChildren().size();

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 onClick$save has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void onClick$save() {
        List<WrongValueException> wve = new ArrayList<>();
        if ("".equals(field1.getValue())) {
            gb.setOpen(true);
            wve.add(new WrongValueException(field1, "Field 1 is mandatory"));
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/test2/B86_ZK_4144Composer.java - About 35 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 equals has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        @Override
        public boolean equals(Object obj) {
            if (this == obj)
                return true;
            if (obj == null)

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 coerceToDisplayLabel has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private String coerceToDisplayLabel(String label) {
        String[] contentArr = label.split("\n");
        StringBuilder result = new StringBuilder();
        int no = 0;
        Pattern noPattern = Pattern.compile("^([0-9]+\\.).*");
Severity: Minor
Found in zktest/src/main/java/org/zkoss/zktest/comp/Teststeps.java - About 35 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 getAutomaticTimeout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static Boolean getAutomaticTimeout(Desktop desktop) {
        if (desktop != null)
            for (Page page : desktop.getPages()) {
                Boolean b = ((PageCtrl) page).getAutomaticTimeout();
                if (b != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 35 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 encodeId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String encodeId(StringBuffer sb, int val) {
        //Thus, the number will 0, 1... max, 0, 1..., max, 0, 1 (less conflict)
        if (val < 0 && (val += Integer.MIN_VALUE) < 0)
            val = -val; //impossible but just in case

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.java - About 35 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 applyForward has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final void applyForward(Component comp, String forward) {
        if (forward == null)
            return;

        final Map<String, Collection<String>> fwds = new LinkedHashMap<String, Collection<String>>(); //remain the order
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.java - About 35 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 getId has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public String getId(String uuid) {
        if (_idmap != null)
            for (String[] idinf : _idmap)
                if (uuid.equals(idinf[0]))
                    return idinf[1];
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.java - About 35 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 resolveInsertComponents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void resolveInsertComponents(Collection<Component> comps, Map<String, Component> map) {
        for (Component comp : comps) {
            final Annotation annt = ((ComponentCtrl) comp).getAnnotation(null, "insert");
            if (annt != null) {
                final String insertName = annt.getAttribute("value");
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Composition.java - About 35 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 getEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static Event getEvent(AuRequest request) {
        final String name = request.getCommand();
        final Component comp = request.getComponent();
        final Map<String, Object> data = request.getData();
        //ZK-1847 should check whether data is empty or not
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/event/Event.java - About 35 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 getRichletByPath has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Richlet getRichletByPath(String path) {
        if (path == null || path.length() == 0 || "/".equals(path))
            path = "";
        else if (path.charAt(0) != '/')
            path = '/' + path;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Configuration.java - About 35 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