Showing 4,841 of 7,782 total issues

Menuitem has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Menuitem extends LabelImageElement implements org.zkoss.zk.ui.ext.Disable,
        org.zkoss.zk.ui.ext.Uploadable {
    private AuxInfo _auxinf;

    static {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Menuitem.java - About 3 hrs to fix

    Scrollbar has 29 functions (exceeds 20 allowed). Consider refactoring.
    Open

    @zk.WrapClass('zul.Scrollbar')
    export class Scrollbar extends zk.Object {
        /** The container object for this scrolling that user can scroll the whole content
         * @type DOMElement
         */
    Severity: Minor
    Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 3 hrs to fix

      Function update has 87 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function update(source) {
        var duration = d3.event && d3.event.altKey ? 5000 : 500;
      
        // Compute the new tree layout.
        var nodes = tree.nodes(root).reverse();
      Severity: Major
      Found in zktest/src/main/webapp/js/dtree.js - About 3 hrs to fix

        Function _sanitizeAttributes has 87 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
              /* Execute a hook if present */
              _executeHook('beforeSanitizeAttributes', currentNode, null);
              const {
                attributes
        Severity: Major
        Found in zk/src/main/resources/web/js/zk/ext/purify.js - About 3 hrs to fix

          Method newInstance has 86 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static ExpressionFactory newInstance(Properties properties) {
                  ExpressionFactory result = null;
          
                  ClassLoader tccl = ClassUtil.getContextClassLoader(ExpressionFactory.class);
          
          Severity: Major
          Found in zel/src/main/java/org/zkoss/zel/ExpressionFactory.java - About 3 hrs to fix

            Method jjStopStringLiteralDfa_1 has 86 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            private final int jjStopStringLiteralDfa_1(int pos, long active0)
            {
               switch (pos)
               {
                  case 0:
            Severity: Major
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 3 hrs to fix

              Method jjStopStringLiteralDfa_2 has 86 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              private final int jjStopStringLiteralDfa_2(int pos, long active0)
              {
                 switch (pos)
                 {
                    case 0:
              Severity: Major
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 3 hrs to fix

                Method parse has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void parse(Element root, Configuration config, Locator locator) throws Exception {
                        l_out: for (Iterator it = root.getElements().iterator(); it.hasNext();) {
                            final Element el = (Element) it.next();
                            final String elnm = el.getName();
                            // B65-ZK-1671: ThemeProvider specified in metainfo/zk/zk.xml may get overridden by default
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 3 hrs to fix

                  File DHtmlLayoutPortlet.java has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    Method addByRawValueInV6 has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void addByRawValueInV6(String annotName, String rval,
                                Location loc) {
                            final Map<String, String[]> attrs = new LinkedHashMap<String, String[]>(
                                    4);
                            final int len = rval.length();
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.java - About 3 hrs to fix

                      File BindELContext.java has 310 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      /* BindELContext.java
                      
                          Purpose:
                              
                          Description:
                      Severity: Minor
                      Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.java - About 3 hrs to fix

                        Method resolve has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected Object resolve(ELContext ctx, Object base, Object property) {
                                VariableResolver resolver = _ctx.getVariableResolver();
                                if (resolver != null) {
                                    if (resolver instanceof VariableResolverX) {
                                        final Object o = ((VariableResolverX)resolver)
                        Severity: Minor
                        Found in zcommon/src/main/java/org/zkoss/xel/zel/XelELResolver.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 getFormat0 has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private String getFormat0() throws IOException {
                                String format = null;
                                if (_data != null) {
                                    try {
                                        format =
                        Severity: Minor
                        Found in zcommon/src/main/java/org/zkoss/sound/AAudio.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 unwrap has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static final Throwable unwrap(Throwable ex) {
                                for (;;) {
                                    if (ex instanceof InvocationTargetException)
                                        ex = ex.getCause(); //might returns UndeclaredThrowableException
                                    else if (ex instanceof UndeclaredThrowableException)
                        Severity: Minor
                        Found in zcommon/src/main/java/org/zkoss/lang/Exceptions.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 looselyCast has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static Object looselyCast(Class type, Object arg) {
                                if (type == Integer.class || type == int.class) {
                                    if (arg instanceof Number)
                                        return ((Number) arg).intValue();
                                } else if (type == Long.class || type == long.class) {
                        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 coerce has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public static Object coerce(Class<?> cls, Object val, boolean nullable)
                            throws ClassCastException {
                                if (nullable || val != null)
                                    return coerce(cls, val);
                        
                        
                        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 applyForward0 has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static final void applyForward0(Component comp, String orgEvent, String cond) {
                                int len;
                                if (cond == null || (len = cond.length()) == 0)
                                    len = (cond = orgEvent).length();
                                //if condition not specified, assume same as orgEvent (to space owenr)
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/sys/ComponentsCtrl.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 next has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public boolean next() {
                                if (_done)
                                    throw new IllegalStateException("Iterate twice not allowed");
                        
                                if (_status == null) {
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.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 doView has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            protected void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
                                //try parameter first and then attribute
                                boolean bRichlet = false;
                                String path = request.getParameter(ATTR_PAGE);
                                if (path == null) {
                        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 parseZScript has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private void parseZScript(NodeInfo parent, Element el, AnnotationHelper annHelper) {
                                if (el.getAttributeItem("forEach") != null)
                                    throw new UiException(message("forEach not applicable to <zscript>", el));
                                if (annHelper.clear())
                                    log.warn(message("Annotations are ignored since <zscript> doesn't support them", el));
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.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