Showing 4,841 of 7,782 total issues

Method render has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        public void render(final Radio item, final Object data, final int index) throws Exception {
            final Radiogroup cb = (Radiogroup) item.getParent();
            final Template tm = cb.getTemplate("model");
            if (tm == null) {
                item.setLabel(Objects.toString(data));
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Radiogroup.java - About 2 hrs to fix

    Function startOf has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function startOf(units) {
            var time, startOfDate;
            units = normalizeUnits(units);
            if (units === undefined || units === 'millisecond' || !this.isValid()) {
                return this;
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 2 hrs to fix

      Function zkMemberMethods has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function zkMemberMethods(members, isStatic) {
              if (!members) {
                  return [];
              }
              const methods = [];
      Severity: Major
      Found in eslint-plugin-zk/src/transform.js - About 2 hrs to fix

        Function sync has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                sync(): void {
                    var opts = this._opts,
                        anchor = opts.anchor,
                        $anchor = zk(anchor);
        
        
        Severity: Major
        Found in zk/src/main/resources/web/js/zk/effect.ts - About 2 hrs to fix

          File Input.java has 261 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* Input.java
          
              Purpose:
                  
              Description:
          Severity: Minor
          Found in zhtml/src/main/java/org/zkoss/zhtml/Input.java - About 2 hrs to fix

            Method smartWrite has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public static <T> void smartWrite(ObjectOutputStream s, Collection<T> col)
                throws IOException {
                    if (col != null) {
                        final boolean debug = logio.isDebugEnabled();
                        for (T val: col) {
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/io/Serializables.java - About 2 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 smartWrite has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public static <T> void smartWrite(ObjectOutputStream s, T[] ary)
                throws IOException {
                    if (ary != null) {
                        final boolean debug = logio.isDebugEnabled();
                        for (int j = 0; j < ary.length; ++j) {
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/io/Serializables.java - About 2 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 MapEntry has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              final public void MapEntry() throws ParseException {
                                        /*@bgen(jjtree) MapEntry */
              AstMapEntry jjtn000 = new AstMapEntry(JJTMAPENTRY);
              boolean jjtc000 = true;
              jjtree.openNodeScope(jjtn000);
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 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 BracketSuffix has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              final public void BracketSuffix() throws ParseException {
                                                   /*@bgen(jjtree) BracketSuffix */
              AstBracketSuffix jjtn000 = new AstBracketSuffix(JJTBRACKETSUFFIX);
              boolean jjtc000 = true;
              jjtree.openNodeScope(jjtn000);
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 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 getTarget has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                private final Target getTarget(EvaluationContext ctx) throws ELException {
                    ctx.putContext(AstValue.class, new Integer(this.jjtGetNumChildren()));
                    // evaluate expr-a to value-a
                    ctx.putContext(Node.class, this.children[0]); //20110905, henrichen: bind property node
                    Object base = this.children[0].getValue(ctx);
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstValue.java - About 2 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 DeferredExpression has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              final public void DeferredExpression() throws ParseException {
                                                             /*@bgen(jjtree) DeferredExpression */
              AstDeferredExpression jjtn000 = new AstDeferredExpression(JJTDEFERREDEXPRESSION);
              boolean jjtc000 = true;
              jjtree.openNodeScope(jjtn000);
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 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 DynamicExpression has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

              final public void DynamicExpression() throws ParseException {
                                                           /*@bgen(jjtree) DynamicExpression */
              AstDynamicExpression jjtn000 = new AstDynamicExpression(JJTDYNAMICEXPRESSION);
              boolean jjtc000 = true;
              jjtree.openNodeScope(jjtn000);
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 2 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 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public Object getValue(ELContext context, Object base, Object property) {
            
                    if (context == null) {
                        throw new NullPointerException();
                    }
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/StaticFieldELResolver.java - About 2 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 visit has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public void visit(Node node) throws ELException {
                    if (node instanceof AstFunction) {
            
                        AstFunction funcNode = (AstFunction) node;
            
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/lang/ExpressionBuilder.java - About 2 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 outHeaderZkTags has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public static String outHeaderZkTags(Execution exec, Page page) {
                    String s1 = outHeaders(exec, page, true), s2 = outZkTags(exec, null, null), s3 = outHeaders(exec, page, false);
                    return s1 != null ? s2 != null ? s3 != null ? s1 + s2 + s3 : s1 + s2 : s3 != null ? s1 + s3 : s1
                            : //s2 null
                            s2 != null ? s3 != null ? s2 + s3 : s2 : s3 != null ? s3 : null; //s2 null
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 2 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 parseClass has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                private static <T> Class<T> parseClass(Element el, String elnm, Class<?> cls, boolean required) {
                    //Note: we throw exception rather than warning to make sure
                    //the developer correct it
                    final String clsnm = el.getElementValue(elnm, true);
                    if (clsnm != null && clsnm.length() != 0) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 2 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 matchPseudoElements has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                private static boolean matchPseudoElements(Component comp, List<PseudoElement> pseudoElements) {
                    if (pseudoElements == null || pseudoElements.isEmpty())
                        return true;
                    if (comp instanceof ShadowElement) {
                        for (PseudoElement pe : pseudoElements) {

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

                @SuppressWarnings("unchecked")
                private static final ResourceCache<PageDefinition> getCache(WebApp wapp) {
                    ResourceCache<PageDefinition> cache = (ResourceCache<PageDefinition>) wapp.getAttribute(ATTR_PAGE_CACHE);
                    if (cache == null) {
                        synchronized (PageDefinitions.class) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/PageDefinitions.java - About 2 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 apply has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                public void apply(Component comp) {
                    if (_attrs != null && isEffective(comp)) {
                        final Evaluator eval = getEvaluator();
                        for (Map.Entry<String, Object> me : _attrs.entrySet()) {
                            final String name = me.getKey();
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/AttributesInfo.java - About 2 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 removeForward0 has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
            Open

                private boolean removeForward0(String orgEvent, Object target, String targetEvent) {
                    if (_auxinf != null && _auxinf.forwards != null) {
                        final ForwardInfo info = _auxinf.forwards.get(orgEvent);
                        if (info != null) {
                            final List<TargetInfo> tis = info.targets;
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 2 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