Showing 4,841 of 7,782 total issues

Audio has 28 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Audio extends XulElement implements MediaElement {
    /**
     * Represent the stop state
     * @since 9.6.0
     */
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Audio.java - About 3 hrs to fix

    Img has 28 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Img extends AbstractAction {
        private String _id, _onclick;
        private String _src, _height, _width, _border, _hspace, _vspace;
        private String _align, _title, _alt, _sclass, _style;
    
    
    Severity: Minor
    Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/action/html/Img.java - About 3 hrs to fix

      Method parseComponentDirective has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void parseComponentDirective(PageDefinition pgdef, ProcessingInstruction pi, Map<String, String> params)
                  throws Exception {
              final String name = params.remove("name");
              noELnorEmpty("name", name, pi);
      
      
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 3 hrs to fix

        Method addInfo has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void addInfo(JSONObject info) {
        
                Object type = info.get("type");
                if (!_startLine) {
                    out("=======================================");

          Method syncModel0 has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void syncModel0(int offset, int limit) {
                  int min = offset;
                  int max = offset + limit - 1;
          
                  final ListModel _model = _listbox.getModel();
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 3 hrs to fix

            Method setModel has 83 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void setModel(ListModel<?> model) {
                    //ZK-3514: speed up
                    if (_model != null && _model != model) {
                        int threshold = Utils.getIntAttribute(this, "org.zkoss.zul.invalidateThreshold", 10, true);
                        int diff = Math.abs((model != null ? model.getSize() : 0) - _model.getSize());
            Severity: Major
            Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 3 hrs to fix

              Method parseShadowElement has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private static NodeInfo parseShadowElement(PageDefinition pgdef, NodeInfo parent, Element el,
                          AnnotationHelper annHelper) throws Exception {
                      String ifc = null, unless = null, name = el.getLocalName();
                      AnnotationHelper attrAnnHelper = null;
                      final LanguageDefinition lookup = LanguageDefinition.lookup("xul/html");
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 3 hrs to fix

                Method init has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void init(Object context, Configuration config) {
                        if (_config != null)
                            throw new IllegalStateException("Cannot be initialized twice");
                        if (config == null)
                            throw new IllegalArgumentException("null");
                Severity: Major
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java - About 3 hrs to fix

                  Method syncModel has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void syncModel(int offset, int limit) {
                          int min = offset;
                          int max = offset + limit - 1;
                  
                          final ListModel model = _grid.getModel();
                  Severity: Major
                  Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java - About 3 hrs to fix

                    Method coerceToNumber has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected static final Number coerceToNumber(final Number number,
                                final Class<?> type) throws ELException {
                            if (Long.TYPE == type || Long.class.equals(type)) {
                                return Long.valueOf(number.longValue());
                            }
                    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 buildCompCtx0 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private ComponentMatchCtx buildCompCtx0(ComponentMatchCtx ctx) {
                            for (Selector selector : _selectorList) {
                                int i = selector.getSelectorIndex();
                                int posEnd = _posOffset > 0 ? _posOffset - 1 : 0;
                                int len = selector.size();
                    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 processWpdForSourcemapIfAny has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private String processWpdForSourcemapIfAny(List<String> paths, String originalPathPrefix, String path) throws Exception {
                            final Content content = (Content) _cache.get(path);
                            if (content == null) {
                                log.error("Failed to load the resource: " + path);
                                throw new java.io.FileNotFoundException("Failed to load the resource: " + path);
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.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 buildNextShadowRootSiblingCtx has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private ComponentMatchCtx buildNextShadowRootSiblingCtx(ComponentMatchCtx ctx, HtmlShadowElement htmlShadowElement) {
                            ctx.moveToNextShadowSibling(htmlShadowElement);
                            //TODO need to match selectors
                            for (Selector selector : _selectorList) {
                                int i = selector.getSelectorIndex();
                    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 getClass has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                                protected CharClass getClass(Character c) {
                    
                                    if (_inDoubleQuote && (_escaped || c != '"'))
                                        return CharClass.LITERAL;
                    
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/Tokenizer.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 adjustInsertionForInsertBefore has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        private boolean adjustInsertionForInsertBefore(HtmlShadowElement se, Component target, Component insertBefore) {
                            Component old = null;
                            Direction direction = inRange(se, insertBefore);
                            switch (direction) {
                            case PREVIOUS:
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 clearChildren has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void clearChildren() {
                            AbstractComponent hostIfAny = (AbstractComponent) getShadowHostIfAny();
                            try {
                                if (hostIfAny != null) {
                                    hostIfAny.disableHostChanged();
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 setPageBefore has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void setPageBefore(Page page, Component refRoot) {
                            beforeComponentPageChanged(page);
                            if (refRoot != null && (page == null || refRoot.getParent() != null || refRoot.getPage() != page))
                                refRoot = null;
                            if (refRoot != null /*&& refRoot.getPage() == page (checked)*/
                    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 getAttributes has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public Map<String, Object> getAttributes(int scope) {
                            switch (scope) {
                            case SPACE_SCOPE:
                                if (this instanceof IdSpace)
                                    return getAttributes();
                    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 redraw has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public void redraw(final Writer out) throws IOException {
                            final int order = ComponentRedraws.beforeRedraw(false);
                            final boolean aupg = isAsyncUpdate();
                            final String extra;
                            try {
                    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 resolveParameter has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected Object resolveParameter(Annotation[] parmAnnos, Class<?> paramType, Method method, int index) {
                            Object val = null;
                            boolean hitResolver = false;
                            Default defAnno = null;
                            for (Annotation anno : parmAnnos) {
                    Severity: Minor
                    Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.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