Showing 4,841 of 7,782 total issues

Method sessionTimeout has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    private void sessionTimeout(HttpServletRequest request, HttpServletResponse response, WebApp wapp, String dtid,
            boolean compress) throws ServletException, IOException {
        final String sid = request.getHeader("ZK-SID");
        if (sid != null) {
            //B65-ZK-2464 : Possible XSS Vulnerability in HTTP Header
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.java - About 4 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 getFromScope has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

        protected Object getFromScope(String name) {
            final BSHInterpreter ip = getInterpreter(_scope);
            final Scope curr = ip != null ? ip.getCurrent() : null;
            if (curr == null)
                return getImplicit(name); //ignore scope
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.java - About 4 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 coerceToUi has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    public Object coerceToUi(Object val, Component comp, BindContext ctx) {
        Tabbox tbx = (Tabbox) comp;
        final ListModel<?> model = tbx.getModel();
        //ZK-762 selection of ListModelList is not correct if binding to selectedItem

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

    public void render(final Listitem item, final Object data, final int index) throws Exception {
        final Listbox listbox = (Listbox) item.getParent();
        final int size = listbox.getModel().getSize();
        //B70-ZK-2555: in order to handle dynamic template name
        final String subtype = item instanceof Listgroup ? "group" : item instanceof Listgroupfoot ? "groupfoot" : null;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BindListitemRenderer.java - About 4 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 fixGroupsInfoBeforeInsert has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    private void fixGroupsInfoBeforeInsert(Row newItem, Row refChild, boolean isReorder) {
        if (_isReplacingRow) //@see Grid.Renderer#render
            return; //called by #insertBefore(), skip handling GroupInfo

        if (newItem instanceof Groupfoot) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 4 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 removePartial has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private boolean removePartial(Collection<?> master, Collection<?> c, boolean isRemove, boolean byKey,
            boolean byValue) {
        int sz = c.size();
        int removed = 0;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/ListModelMap.java - About 4 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 init has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    init: function(a, b, c) {
        a = unescape(encodeURIComponent(a));
        b = b || -1;
        c = c || 2;
        this.barcode_array = {};
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - About 4 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 afterLoad has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

export function afterLoad(a: string | CallableFunction, b?: CallableFunction, front?: boolean): boolean | void {
    if (typeof a == 'string') {
        if (!b) return true;

        for (var pkgs = a.split(','), j = pkgs.length; j--;) {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/pkg.ts - About 4 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 panel$mold$ has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

function panel$mold$(out, skipper) {
    var uuid = this.uuid,
        title = this.getTitle(),
        caption = this.caption,
        btnRenderer = zul.wgt.ButtonRenderer,
Severity: Minor
Found in zul/src/main/resources/web/js/zul/wnd/mold/panel.js - About 4 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 _swipeEnd has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    _swipeEnd(devt: JQuery.TriggeredEvent): void {
        jq(this.node).off(moveEvt, this.proxy(this._swipeMove));
        if (start && stop && this.opts) {
            var dispX: number | undefined, dispY: number | undefined,
                dispT = stop.time - start.time, dir: 'left' | 'right' | 'up' | 'down' | undefined;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/zswipe.ts - About 4 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 encodeXML has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

        static encodeXML(txt: string | null, opts?: EncodeXmlOptions): string {
            txt = txt != null ? String(txt) : '';

            if (!opts) // speed up the replacement.
                return _encodeXML0(txt);
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - About 4 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 execUpdate has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void execUpdate(Execution exec, List<AuRequest> requests, AuWriter out) throws IOException {
        if (requests == null)
            throw new IllegalArgumentException();
        //        assert ExecutionsCtrl.getCurrentCtrl() == null:
        //            "Impossible to re-activate for update: old="+ExecutionsCtrl.getCurrentCtrl()+", new="+exec;
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 4 hrs to fix

    Function then has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

                    then: function( onFulfilled, onRejected, onProgress ) {
                        var maxDepth = 0;
                        function resolve( depth, deferred, handler, special ) {
                            return function() {
                                var that = this,
    Severity: Major
    Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 4 hrs to fix

      File AnnotationHelper.java has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* AnnotationHelper.java
      
          Purpose:
              
          Description:
      Severity: Minor
      Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/impl/AnnotationHelper.java - About 4 hrs to fix

        File ResourceHttpServletRequest.java has 336 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* ResourceHttpServletRequest.java
        
        {{IS_NOTE
            Purpose:
                

          Method findWrapper has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @SuppressWarnings("null")
              private static Wrapper findWrapper(Class<?> clazz, List<Wrapper> wrappers,
                      String name, Class<?>[] paramTypes, Object[] paramValues) {
          
                  Map<Wrapper,MatchResult> candidates = new HashMap<Wrapper,MatchResult>();
          Severity: Major
          Found in zel/src/main/java/org/zkoss/zel/Util.java - About 4 hrs to fix

            Method load has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public final static void load(Map<? super String, ? super String> map, InputStream sm, String charset,
                boolean caseInsensitive) throws IOException {
                    final PushbackInputStream pis = new PushbackInputStream(sm, 3);
                    if (charset == null || charset.startsWith("UTF")) {
                        final byte[] ahead = new byte[3];
            Severity: Major
            Found in zcommon/src/main/java/org/zkoss/util/Maps.java - About 4 hrs to fix

              Strings has 32 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class Strings {
                  public static final String EMPTY = "";
                  /**
                   * Returns true if the string is null or empty.
                   */
              Severity: Minor
              Found in zcommon/src/main/java/org/zkoss/lang/Strings.java - About 4 hrs to fix

                AbstractWebApp has 32 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public abstract class AbstractWebApp implements WebApp, WebAppCtrl {
                    private static final Logger log = LoggerFactory.getLogger(AbstractWebApp.class);
                
                    private String _appnm;
                    private Configuration _config;
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java - About 4 hrs to fix

                  GroupsListModel has 32 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class GroupsListModel<D, G, F> extends AbstractListModel<Object> implements GroupsSelectableModel<Object> {
                      protected GroupsModel<D, G, F> _model;
                      private transient int _size;
                      /** An array of the group offset.
                       * The group offset is the offset from 0 that a group shall appear
                  Severity: Minor
                  Found in zul/src/main/java/org/zkoss/zul/impl/GroupsListModel.java - About 4 hrs to fix
                    Severity
                    Category
                    Status
                    Source
                    Language