Showing 4,841 of 7,782 total issues

Method execNonComponent has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    private static final void execNonComponent(CreateInfo ci, Component comp, Object meta) {
        final Page page = ci.page;
        if (meta instanceof AttributesInfo) {
            final AttributesInfo attrs = (AttributesInfo) meta;
            if (comp != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 getVisibleIndexOfItem0 has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    private int getVisibleIndexOfItem0(Treeitem item, boolean inclusive) {
        // ZK-2539: use vector instead of recursive calls to avoid stack overflow
        // when number of tree items is huge.
        Vector<Treeitem> items = new Vector<Treeitem>();
        int count = 0;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 getAvailableAtClient has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    protected Set<? extends Component> getAvailableAtClient(int offset, int limit) {
        final Set<Component> avail = new LinkedHashSet<Component>(32);
        final Rows rows = _grid.getRows();
        Row row = (Row) rows.getFirstChild();
        while (row != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.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 stringToInts has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public static final int[] stringToInts(String numbers, int defaultValue) throws WrongValueException {
        if (numbers == null)
            return null;

        List<Integer> list = new LinkedList<Integer>();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/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 setup has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Object setup(HttpSession sess, ServletRequest request, ServletResponse response,
            String charset) {
        if (hasSetup(request)) //processed before?
            return Objects.UNKNOWN;

Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/Charsets.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

Function _array_search has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    _array_search: function(a, b, c) {
        var d = !!c,
            e = "";
        if (b && "object" === typeof b && b.change_key_case) return b.search(a, c);
        if ("object" === typeof a && a.exec) {
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - 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

Function getFlexInfo has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

        getFlexInfo(wgt: zk.Widget): { isFlexRow: boolean; flexContainerChildren: HTMLElement[]; childrenWidgets: zk.Widget[] } {
            let pwgt = wgt.parent,
                cwgt = pwgt!.firstChild,
                fContainer = pwgt!.getFlexContainer_()!,
                fcc = fContainer.firstElementChild as HTMLElement,
Severity: Minor
Found in zk/src/main/resources/web/js/zk/flex.ts - 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

Function go has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

        static go(url: string, opts?: Partial<GoOptions>): void {
            opts = opts || {};
            if (opts.target) {
                open(url, opts.target);
            } else if (opts.overwrite) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - 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

Function zkInitCrashTimer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

window.zkInitCrashTimer = setTimeout(function () {
    var zkErrorCode,
        z_runonce = document.querySelectorAll('.z-runonce')[0],
        zk_proc = document.getElementById('zk_proc'),
        ztemp = document.querySelectorAll('.z-temp')[0],
Severity: Minor
Found in zk/src/main/resources/web/js/zk/crashmsg.ts - 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

Function _syncPosition has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    _syncPosition(orient: string, pos: number): void {
        if (!this._pos)
            return;

        var isH = orient == 'hor',
Severity: Minor
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - 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

File Dates.java has 280 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*    Dates.java


    Purpose:
    Description:
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/Dates.java - About 2 hrs to fix

    Method invoke has 68 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public Object invoke(ELContext context, Object base, Object method,
                Class<?>[] paramTypes, Object[] params) {
            if (context == null) {
                throw new NullPointerException();
            }
    Severity: Major
    Found in zel/src/main/java/org/zkoss/zel/BeanELResolver.java - About 2 hrs to fix

      Method coerceToType has 68 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static final Object coerceToType(final Object obj,
                  Class<?> type) throws ELException {
      
              if (type == null || Object.class.equals(type) ||
                      (obj != null && type.isAssignableFrom(obj.getClass()))) {
      Severity: Major
      Found in zel/src/main/java/org/zkoss/zel/impl/lang/ELSupport.java - About 2 hrs to fix

        Method updateModelByTag has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void updateModelByTag() {
                fileModel.clear();
                final String r = getDesktop().getWebApp().getRealPath("/");
                final File test2 = new File(r, PATH);
                final String pattern = ((Textbox) getFellow("w1").getFellow("fnt"))
        Severity: Major
        Found in zktest/src/main/java/org/zkoss/zktest/test2/MainLayout.java - About 2 hrs to fix

          Method process has 68 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected boolean process(Session sess, RenderRequest request, RenderResponse response, String path,
                      boolean bRichlet) throws PortletException, IOException {
                  //        if (log.isDebugEnabled()) log.debug("Creates from "+path);
                  final WebManager webman = getWebManager();
                  final WebApp wapp = webman.getWebApp();
          Severity: Major
          Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.java - About 2 hrs to fix

            Method removeRedundant has 68 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private void removeRedundant() {
                    int initsz = (_invalidated.size() + _attached.size()) / 2 + 30;
                    final Set<Component> ins = new HashSet<Component>(initsz), //one of ancestor in _invalidated or _attached
                            outs = new HashSet<Component>(initsz); //none of ancestor in _invalidated nor _attached
                    final List<Component> ancs = new ArrayList<Component>(50);
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 2 hrs to fix

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

                  public void render(final Treeitem item, final Object data, final int index) throws Exception {
                      final Tree tree = item.getTree();
                      final Component parent = item.getParent();
                      final Template tm = resolveTemplate(tree, parent, data, index, -1, "model");
                      // ZK-2859: to replace the id of the the original treeitem that is not from the template
              Severity: Major
              Found in zkbind/src/main/java/org/zkoss/bind/impl/BindTreeitemRenderer.java - About 2 hrs to fix

                Method service has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public void service(org.zkoss.zk.au.AuRequest request, boolean everError) {
                        final String cmd = request.getCommand();
                        if (cmd.equals(Events.ON_OPEN)) {
                            OpenEvent evt = OpenEvent.getOpenEvent(request);
                            _open = evt.isOpen();
                Severity: Major
                Found in zul/src/main/java/org/zkoss/zul/Combobox.java - About 2 hrs to fix

                  File Tab.java has 280 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

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

                    Method doListDataChange has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public void doListDataChange(ListDataEvent event) {
                            if (INVALIDATE_THRESHOLD == -1) {
                                INVALIDATE_THRESHOLD = Utils.getIntAttribute(this.getOwner(), "org.zkoss.zul.invalidateThreshold", 10,
                                        true);
                            }
                    Severity: Major
                    Found in zul/src/main/java/org/zkoss/zul/impl/ListboxDataLoader.java - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language