Showing 4,841 of 7,782 total issues

Method validate has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void validate(Component comp, Object value) throws WrongValueException {
        if (!_finishParseCst) {
            if (_raw != null) parseCst(_raw);
            _finishParseCst = true;
        }
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 2 hrs to fix

    File XulElement.java has 255 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

      Method parse0 has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static void parse0(Context ctx, Node parent, int from, int to)
                  throws DspException, IOException, XelException {
              boolean esc = false;
              final StringBuffer sb = new StringBuffer(512);
              for (int j = from; j < to; ++j) {
      Severity: Major
      Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 2 hrs to fix

        Function d3_scale_log has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function d3_scale_log(linear, log) {
          var pow = log.pow;
        
          function scale(x) {
            return linear(log(x));
        Severity: Major
        Found in zktest/src/main/webapp/js/d3.js - About 2 hrs to fix

          Function histogram has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          d3.layout.histogram = function() {
            var frequency = true,
                valuer = Number,
                ranger = d3_layout_histogramRange,
                binner = d3_layout_histogramBinSturges;
          Severity: Major
          Found in zktest/src/main/webapp/js/d3.layout.js - About 2 hrs to fix

            Method load has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                private static final boolean load(String flnm) {
                    final InputStream strm = ContentTypes.class.getResourceAsStream(flnm);
                    if (strm == null)
                        return false;
            
            
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/util/media/ContentTypes.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 afterRenderHtml has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public static void afterRenderHtml(Execution exec, Page page, Writer out, Object param)
                        throws IOException {
                    if (param == null)
                        return; // nothing to do
            
            
            Severity: Minor
            Found in zhtml/src/main/java/org/zkoss/zhtml/impl/PageRenderer.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 addHeaderZkTags has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                /* package */ static void addHeaderZkTags(Execution exec, Page page, StringBuffer buf,
                        String tag) {
                    if (HtmlPageRenders.isDirectContent(exec)) {
                        final String zktags = HtmlPageRenders.outHeaderZkTags(exec, page);
                        if (zktags != null && zktags.length() > 0) {
            Severity: Minor
            Found in zhtml/src/main/java/org/zkoss/zhtml/Utils.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 close has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public void close() throws IOException {
                    _cntsz = 0;
                    if (_org != null) {
                        _org.close();
            
            
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/io/RepeatableReader.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 getFunctionMapper has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public static final FunctionMapper getFunctionMapper(Collection<Taglib> taglibs,
                Map<String, Class<?>> imports, Collection<FunctionDefinition> funcs, Locator loc) {
                    TaglibMapper mapper = null;
                    if (taglibs != null && !taglibs.isEmpty()) {
                        mapper = new TaglibMapper();
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/xel/taglib/Taglibs.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 close has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public void close() throws IOException {
                    _cntsz = 0;
                    if (_org != null) {
                        _org.close();
            
            
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/io/RepeatableInputStream.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 toXMLName has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public static final String toXMLName(String name) {
                    if (name == null || name.length() == 0)
                        return "_";
            
                    StringBuffer sb = null;
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/xml/XMLs.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 getElements has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public final List<Element> getElements(String namespace, String name, int mode) {
                    if (_elemMap != null && namespace == null && mode == FIND_BY_TAGNAME)
                        return getElements(name); //use the speed version
            
                    final Pattern ptn =
            Severity: Minor
            Found in zcommon/src/main/java/org/zkoss/idom/impl/AbstractGroup.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 doGet has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                protected void doGet(HttpServletRequest request, HttpServletResponse response)
                        throws ServletException, IOException {
                    Servlets.getBrowser(request); //update request info
            
                    final String path = Https.getThisServletPath(request);

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

                private static Method getMethod(Class<?> type, Method m) {
                    if (m == null || Modifier.isPublic(type.getModifiers())) {
                        return m;
                    }
                    Class<?>[] inf = type.getInterfaces();
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 compare has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                @SuppressWarnings({ "rawtypes", "unchecked" })
                private Optional compare(boolean isMax) {
                    Comparable result = null;
            
                    if (iterator.hasNext()) {
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/stream/Stream.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 jj_consume_token has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

              private Token jj_consume_token(int kind) throws ParseException {
                Token oldToken;
                if ((oldToken = token).next != null) token = token.next;
                else token = token.next = token_source.getNextToken();
                jj_ntk = -1;
            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 getMethod has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                static Method getMethod(Class<?> type, Method m) {
                    if (m == null || Modifier.isPublic(type.getModifiers())) {
                        return m;
                    }
                    Class<?>[] inf = type.getInterfaces();
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/Util.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 getType has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                public Class<?> getType(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 remove0 has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

                private boolean remove0(String name, Scope ctxscope) {
                    Map<String, EventQueue> eqs;
                    Object ctxLock = Scopes.getLockForScopeIfAny(ctxscope);
            
                    synchronized (ctxLock) {

            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