Showing 4,841 of 7,782 total issues

File ValidationMessagesImpl.java has 296 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ValidationMessagesImpl.java

    Purpose:
        
    Description:
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/ValidationMessagesImpl.java - About 3 hrs to fix

    Method nextSeparator has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public static int nextSeparator(String src, int from, char[] separators,
        boolean escBackslash, boolean escQuot, boolean quotAsSeparator,
        boolean parenthesis) {
            boolean esc = false;
            char quot = (char)0, endparen;
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 3 hrs 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 nextToken has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public static final Result nextToken(String src, int from,
        char[] separators, boolean escBackslash, boolean quotAsToken,
        boolean parenthesis)
        throws IllegalSyntaxException {
            final int len = src.length();
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 3 hrs 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 setValue has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public void setValue(ELContext context, Object base, Object property,
                Object value) {
            if (context == null) {
                throw new NullPointerException();
            }
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/BeanELResolver.java - About 3 hrs 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 importStatic has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public void importStatic(String name) throws org.zkoss.zel.ELException {
            int lastPeriod = name.lastIndexOf('.');
    
            if (lastPeriod < 0) {
                throw new ELException(Util.message(
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/ImportHandler.java - About 3 hrs 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 getValue has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public Object getValue(EvaluationContext ctx) throws ELException {
            ctx.putContext(AstValue.class, new Integer(this.jjtGetNumChildren()));
            ctx.putContext(Node.class, this.children[0]); //20110905, henrichen: bind property node
            Object base = this.children[0].getValue(ctx);
            ctx.putContext(Node.class, this.children[0]); //20110905, henrichen: bind property node
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstValue.java - About 3 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public static final boolean equals(final Object obj0, final Object obj1)
                throws ELException {
            if (obj0 == obj1) {
                return true;
            } else if (obj0 == null || obj1 == null) {
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java - About 3 hrs 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 updateCol has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

            public void updateCol(String id, int col){
                DefaultTreeNode<TestObject> rootNode;
                if (id.startsWith("Row A") || id.startsWith("SubRow A")) {
                    rootNode=(DefaultTreeNode<TestObject>)mymodelA.getRoot();
                } else {
    Severity: Minor
    Found in zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1739_Composer.java - About 3 hrs 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 updateCol has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public void updateCol(Event event, int col) {
            DefaultTreeNode<TestObject> rootNode;
            String id = (String) event.getData();
            if (id.startsWith("Row A") || id.startsWith("SubRow A")) {
                rootNode = (DefaultTreeNode<TestObject>) mymodelA.getRoot();
    Severity: Minor
    Found in zktest/src/main/java/org/zkoss/zktest/test2/B65_ZK_1726_Composer.java - About 3 hrs 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 handleError has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private void handleError(Session sess, RenderRequest request, RenderResponse response, String path, Throwable err,
                String msg) throws PortletException, IOException {
            // ZK-3679
            Throwable cause;
            if (err instanceof OperationException && (cause = err.getCause()) instanceof Expectable)
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.java - About 3 hrs 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 getCommonSeqLength has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private static int getCommonSeqLength(List<Selector> list) {
            List<String> strs = null;
            int max = 0;
            for (Selector selector : list) {
                if (strs == null) {
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/ComponentIterator.java - About 3 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
    Open

            public void onEvent(Event event) {
                final ForwardInfo info = _auxinf.forwards.get(_orgEvent);
                if (info != null)
                    for (TargetInfo ti : new ArrayList<TargetInfo>(info.targets)) {
                        Component target = resolveForwardTarget(ti.target);
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 3 hrs 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 doInit has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        @SuppressWarnings("unchecked")
        public static final Initiators doInit(PageDefinition pagedef, Page page, Initiator[] sysinits) {
            if (sysinits != null)
                try {
                    for (int j = 0; j < sysinits.length; ++j)
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java - About 3 hrs 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 doAfterCompose has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

            public void doAfterCompose(Page page, Component[] comps) throws Exception {
                if (_sysinitEx)
                    for (int j = 0; j < _sysinits.length; ++j) {
                        final Initiator init = _sysinits[j];
                        if (init instanceof InitiatorExt) {
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/Initiators.java - About 3 hrs 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 crop has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private void crop(Set coll, Map<Component, Set<? extends Component>> croppingInfos, boolean bResponse) {
            for (Iterator it = coll.iterator(); it.hasNext();) {
                final Object o = it.next();
                if (!(o instanceof Component))
                    continue;
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 3 hrs 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 resumeAll has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private void resumeAll(Desktop desktop, UiVisualizer uv, List<Throwable> errs) {
            //We have to loop because a resumed thread might resume others
            while (!_resumed.isEmpty()) { //no need to sync (better performance)
                final List<EventProcessingThreadImpl> list;
                synchronized (_resumed) {
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 3 hrs 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 execSwitch has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private static Component[] execSwitch(CreateInfo ci, ZkInfo switchInfo, Component parent, Component insertBefore) {
            final Page page = ci.page;
            if (!switchInfo.getChildren().isEmpty()) {
                final Object switchCond = switchInfo.resolveSwitch(page, parent);
    
    
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 3 hrs 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 22 (exceeds 5 allowed). Consider refactoring.
    Open

        public void render(final Comboitem item, final Object data, final int index) throws Exception {
            final Combobox cb = (Combobox) item.getParent();
            final ListModel<?> model = cb.getModel();
            final int size = model.getSize();
            final Template tm = resolveTemplate(cb, item, data, index, size, "model");
    Severity: Minor
    Found in zkbind/src/main/java/org/zkoss/bind/impl/BindComboitemRenderer.java - About 3 hrs 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 afterUnmarshal has a Cognitive Complexity of 22 (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 Rows) {
                    _rows = (Rows) child;
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Grid.java - About 3 hrs 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 writeObject has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
            s.defaultWriteObject();
    
            boolean written = false;
            if (_sortAsc instanceof RowComparator) {
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/Column.java - About 3 hrs 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