Showing 4,841 of 7,782 total issues

Method renderTab has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public void renderTab(Tab item, final Object data, final int index) throws Exception {
        final Tabbox tabbox = item.getTabbox();
        final Tabs tabs = tabbox.getTabs();
        final int size = tabbox.getModel().getSize();
        final String tmn = "model";
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BindTabboxRenderer.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 coerceToUi has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public Object coerceToUi(Object val, Component comp, BindContext ctx) {
        Tree tree = (Tree) comp;
        final TreeModel<Object> model = tree.getModel();

        if (model != null && !(model instanceof TreeSelectableModel)) {

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 19 (exceeds 5 allowed). Consider refactoring.
Open

    public String render(final Component owner, final Object data, final int index) throws Exception {
        final int size = ((Selectbox) owner).getModel().getSize();
        final Template tm = resolveTemplate(owner, owner, data, index, size, "model");
        if (tm == null) {
            return Objects.toString(data);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BindSelectboxRenderer.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 render has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public void render(final Radio item, final Object data, final int index) throws Exception {
        final Radiogroup radiogroup = item.getRadiogroup();
        final int size = radiogroup.getModel().getSize();
        final Template tm = resolveTemplate(radiogroup, item, data, index, size, "model");
        if (tm == null) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BindRadioRenderer.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 doInitRenderer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private void doInitRenderer() {
        if (getPage() == null)
            return;
        final Renderer renderer = new Renderer();
        try {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Grid.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 service has a Cognitive Complexity of 19 (exceeds 5 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: Minor
Found in zul/src/main/java/org/zkoss/zul/Combobox.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 updateHeadercmTristate has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    private void updateHeadercmTristate(Set<?> partialSelections) {
        if (getTreecols() != null) {
            boolean treecolShouldBePartial = false;
            int numberOfChild = 0,
                    selectedChild = 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 getPreferredLocale has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    public static final Locale getPreferredLocale(HttpSession sess, ServletRequest request) {
        final String s = Library.getProperty(Attributes.PREFERRED_LOCALE);
        final Locale l = (s != null) ? Locales.getLocale(s) : request.getLocale();
        if (sess != null) {
            Object v = sess.getAttribute(Attributes.PREFERRED_LOCALE);
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 _overflowElement has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function _overflowElement(self: JQZK, recursive): [HTMLElement, HTMLElement][] {
    // eslint-disable-next-line zk/noNull
    var el: Node | undefined | null = self.jq[0],
        te, le, oels: [HTMLElement, HTMLElement][] = [];
    do {
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.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 create has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

    create(context) {
        function checkBooleanTypeSyntax(node: TSESTree.TSTypeAnnotation | TSESTree.TSTypeAssertion | TSESTree.TSAsExpression) {
            if (node.typeAnnotation.type === AST_NODE_TYPES.TSUnionType) {
                let booleanType:  TSESTree.TSBooleanKeyword | null | undefined;
                for (const t of node.typeAnnotation.types) {
Severity: Minor
Found in eslint-plugin-zk/src/rules/preferStrictBooleanType.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

Method getPropertyDescriptors has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public PropertyDescriptor[] getPropertyDescriptors(BeanInfo beanInfo, Class<?> clazz) throws IntrospectionException {
        PropertyDescriptor[] introspectorPDsArray = beanInfo.getPropertyDescriptors();
        List<PropertyDescriptor> introspectorPDs = introspectorPDsArray != null ? Arrays.asList(introspectorPDsArray)
                : Collections.<PropertyDescriptor>emptyList();

Severity: Major
Found in zel/src/main/java/org/zkoss/zel/ClassIntrospector.java - About 2 hrs to fix

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

        public void render(final Radio item, final Object data, final int index) throws Exception {
            final Radiogroup radiogroup = item.getRadiogroup();
            final int size = radiogroup.getModel().getSize();
            final Template tm = resolveTemplate(radiogroup, item, data, index, size, "model");
            if (tm == null) {
    Severity: Major
    Found in zkbind/src/main/java/org/zkoss/bind/impl/BindRadioRenderer.java - About 2 hrs to fix

      Function chord has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      d3.svg.chord = function() {
        var source = d3_svg_chordSource,
            target = d3_svg_chordTarget,
            radius = d3_svg_chordRadius,
            startAngle = d3_svg_arcStartAngle,
      Severity: Major
      Found in zktest/src/main/webapp/js/d3.js - About 2 hrs to fix

        Function nest has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        d3.nest = function() {
          var nest = {},
              keys = [],
              sortKeys = [],
              sortValues,
        Severity: Major
        Found in zktest/src/main/webapp/js/d3.js - About 2 hrs to fix

          File Files.java has 272 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* Files.java
          
          
              Purpose: File related utilities.
              Description:
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/io/Files.java - About 2 hrs to fix

            Method processWpdForSourcemapIfAny has 63 lines of code (exceeds 25 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: Major
            Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.java - About 2 hrs to fix

              Method run has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public void run() {
                      ++_nThd;
                      try {
                          while (_ceased == null) {
                              if (!isIdle()) {
              Severity: Major
              Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventProcessingThreadImpl.java - About 2 hrs to fix

                Method initBinder has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private AnnotateBinder initBinder(BindEvaluatorX evalx, Component comp) {
                        final ComponentCtrl compCtrl = (ComponentCtrl) comp;
                        final Annotation idanno = compCtrl.getAnnotation(BINDER_ATTR, ID_ANNO);
                        final Annotation initanno = compCtrl.getAnnotation(BINDER_ATTR, INIT_ANNO);
                        Object binder = null;
                Severity: Major
                Found in zkbind/src/main/java/org/zkoss/bind/BindComposer.java - About 2 hrs to fix

                  Method encodeURL0 has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private static final String encodeURL0(ServletContext ctx, ServletRequest request, ServletResponse response,
                              String uri) throws Exception {
                          if (uri == null || uri.length() == 0)
                              return uri; //keep as it is
                  
                  
                  Severity: Major
                  Found in zweb/src/main/java/org/zkoss/web/servlet/http/Encodes.java - About 2 hrs to fix

                    Function stack has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    d3.layout.stack = function() {
                      var values = Object,
                          order = d3_layout_stackOrders["default"],
                          offset = d3_layout_stackOffsets["zero"],
                          out = d3_layout_stackOut,
                    Severity: Major
                    Found in zktest/src/main/webapp/js/d3.layout.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language