Showing 4,841 of 7,782 total issues

File SimpleSession.java has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* SimpleSession.java

    Purpose:
        
    Description:
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/SimpleSession.java - About 3 hrs to fix

    Method getNextToken has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    public Token getNextToken()
    {
      Token matchedToken;
      int curPos = 0;
    
    Severity: Major
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 3 hrs to fix

      File ConventionWire.java has 323 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* ConventionWire.java
      
          Purpose:
              
          Description:
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWire.java - About 3 hrs to fix

        Method expendValue has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            private String expendValue(Map labels, String value) {
                if (labels != null && value != null) {
                    int offset = 0;
                    while (offset < value.length()) {
                        int start = value.indexOf("${", offset);

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

            private static final AccessibleObject
            myGetAcsObj(Class<?> cls, String name, Class<?>[] argTypes, int flags)
            throws NoSuchMethodException {
                //try public set/get
                final String decoratedName =
        Severity: Minor
        Found in zcommon/src/main/java/org/zkoss/lang/Classes.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 Value has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

          final public void Value() throws ParseException {
              AstValue jjtn001 = new AstValue(JJTVALUE);
              boolean jjtc001 = true;
              jjtree.openNodeScope(jjtn001);
            try {
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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 buildNextShadowCtx has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            private ComponentMatchCtx buildNextShadowCtx() {
                Component comp = _currCtx.getComponent();
                boolean isShadow = comp instanceof ShadowElement;
                Component child = getNextUntrackedChild(comp);
                if (!isShadow) {
        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 process has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            protected boolean process(Session sess, HttpServletRequest request, HttpServletResponse response, String originPath,
                    boolean bRichlet) throws ServletException, IOException {
        
                // Fix Server-Side Request Forgery (SSRF)
                String path = Https.sanitizePath(originPath);
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/http/RichletFilter.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 addByCompoundValue has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            public void addByCompoundValue(String cval, Location loc) {
                final int len = cval.length();
                if (cval.charAt(1) == '{' && cval.charAt(len - 1) == '}') { //Format 1
                    addInV5(cval.substring(2, len - 1));
                    return;
        Severity: Minor
        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.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 renderProperties has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            protected void renderProperties(ContentRenderer renderer) throws IOException {
                _initialized = true;
                render(renderer, "id", _id);
                if (_auxinf != null && !_auxinf.visible) //don't call isVisible since it might be overriden (backward compatible)
                    renderer.render("visible", false);
        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 init has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

                private void init() {
                    _uri = null;
                    final List<Object[]> results = new LinkedList<Object[]>();
                    for (int j = 0, len = _fulfill.length();;) {
                        int k = j;
        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 checkBinding has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            public void checkBinding(Binder binder, Component comp) {
                final ComponentCtrl compCtrl = (ComponentCtrl) comp;
                for (String p : compCtrl.getAnnotatedProperties()) {
                    if (BINDER_ATTR.equals(p) || VIEW_MODEL_ATTR.equals(p) || VALIDATION_MESSAGES_ATTR.equals(p)) {
                        continue;

        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 26 (exceeds 5 allowed). Consider refactoring.
        Open

            public Object getValue(ELContext context, Object base, Object property)
                    throws NullPointerException, PropertyNotFoundException, ELException {
                if (context == null) {
                    throw new NullPointerException();
                }

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

            @SuppressWarnings("unchecked")
            public Object coerceToUi(Object val, Component comp, BindContext ctx) {
                Tree tree = (Tree) comp;
                final TreeModel<Object> model = tree.getModel();
                if (model != null && !(model instanceof TreeSelectableModel)) {

        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 26 (exceeds 5 allowed). Consider refactoring.
        Open

            static boolean equals(Object a, Object b) {
                if (a == b) {
                    return true;
                }
                if (a == null || b == null) {
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 load has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            public void load(BindContext ctx) {
                final Binder binder = getBinder();
                final BindEvaluatorX eval = binder.getEvaluatorX();
                final Component comp = getComponent();
                final BindingExecutionInfoCollector collector = ((BinderCtrl) getBinder()).getBindingExecutionInfoCollector();
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/LoadFormBindingImpl.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 beforeChildAdded has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            public void beforeChildAdded(Component newChild, Component refChild) {
                if (newChild instanceof Rows) {
                    if (_rows != null && _rows != newChild)
                        throw new UiException("Only one rows child is allowed: " + this
                                + "\nNote: rows is created automatically if live data");
        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 onListDataChange has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            private void onListDataChange(ListDataEvent event) {
                int type = event.getType();
                // ZK-4549: should ignore before handling sorting
                if (getAttribute(Attributes.BEFORE_MODEL_ITEMS_RENDERED) != null
                        && (type == ListDataEvent.INTERVAL_ADDED || type == ListDataEvent.INTERVAL_REMOVED))
        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 renderProperties has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException {
                super.renderProperties(renderer);
        
                render(renderer, "name", _name);
                if (_rows > 0)
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Tree.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 beforeChildAdded has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
        Open

            public void beforeChildAdded(Component newChild, Component refChild) {
                if (newChild instanceof Treecols) {
                    if (_treecols != null && _treecols != newChild)
                        throw new UiException("Only one treecols is allowed: " + this);
                } else if (newChild instanceof Treefoot) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/Tree.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