Showing 4,841 of 7,782 total issues

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

    public Set<Property> getValidates(BindContext ctx) {
        final Set<Property> properties = new HashSet<Property>(2);
        //we should not check this binding need to validate or not here,
        //since other validator may want to know the value of porperty of this binding, so just provide it
        final Binder binder = getBinder();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/SaveFormBindingImpl.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 processPropertyBindings has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private void processPropertyBindings(Component comp, String propName) {
        final ComponentCtrl compCtrl = (ComponentCtrl) comp;

        //validator and converter information
        ExpressionAnnoInfo validatorInfo = parseValidator(comp, propName);
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.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 getConverter has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public Converter getConverter(String name) {
        checkInit();
        Converter converter = null;
        if (_hasGetConverterMethod) {
            Object vm = getViewModel();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 getValidator has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    public Validator getValidator(String name) {
        checkInit();
        Validator validator = null;
        if (_hasGetValidatorMethod) {
            Object vm = getViewModel();
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.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 reInitBinder0 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private boolean reInitBinder0(Component comp) {
        //ZK-611 have wrong binding on a removed treecell in a template
        //if it was detached, ignore it
        if (comp.getPage() == null && !(comp instanceof ShadowElement)) {
            return false;
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/tracker/impl/BindUiLifeCycle.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 renderChildren0 has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    private void renderChildren0(Renderer renderer, Treechildren parent, Treeitem ti, Object childNode, int i)
            throws Throwable {
        renderer.render(ti, childNode, i);
        Object v = ti.getAttribute(Attributes.MODEL_RENDERAS);
        if (v != null) { //a new item is created to replace the existent one
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Tree.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 addVisibleItemCount has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ void addVisibleItemCount(int count) {
        if (count != 0) {
            _visibleItemCount += count;
            final Grid grid = getGrid();
            if (grid != null) {
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Rows.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 service has a Cognitive Complexity of 23 (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_CHANGE)) {
            try {
                final Object oldval = _value;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/impl/InputElement.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 doInitRenderer has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("rawtypes")
    private void doInitRenderer() {
        if (getPage() == null)
            return;
        // sync the multiple status from model
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Listbox.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

Function _bc_shift_addsub has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

libbcmath._bc_shift_addsub = function(a, b, c, d) {
    var e, g, f;
    g = b.n_len;
    0 === b.n_value[0] && g--;
    if (!(a.n_len + a.n_scale >= c + g)) throw Error(
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - 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

Function _bc_do_add has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    _bc_do_add: function(a, b, c) {
        var d, e, g, f, h, k, l;
        d = libbcmath.MAX(a.n_scale, b.n_scale);
        e = libbcmath.MAX(a.n_len, b.n_len) + 1;
        c = libbcmath.bc_new_num(e,
Severity: Minor
Found in zktest/src/main/webapp/test2/js/zk-3913-PDF417lib.js - 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

Function sync has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

        sync(): void {
            var opts = this._opts,
                anchor = opts.anchor,
                $anchor = zk(anchor);

Severity: Minor
Found in zk/src/main/resources/web/js/zk/effect.ts - 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

Function undoVParent has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

    undoVParent(): this {
        if (this.hasVParent()) {
            var el = this.jq[0],
                p = el['z_vp'] as undefined | string,
                agt = el['z_vpagt'] as string,
Severity: Minor
Found in zk/src/main/resources/web/js/zk/dom.ts - 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

Function decodeXML has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

        static decodeXML(txt: string): string {
            var out = '';
            if (!txt) return out;

            var k = 0, tl = txt.length;
Severity: Minor
Found in zk/src/main/resources/web/js/zk/utl.ts - 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 toString has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public String toString() {
        StringBuilder sb = new StringBuilder(64);
        Map<String, List<Object>> result = new LinkedHashMap<String, List<Object>>(_stack);
        List<Map<String, String>> listeners = Generics.cast(result.remove("listeners0"));
        List<Map<String, String>> overrides = Generics.cast(result.remove("overrides"));
Severity: Major
Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 3 hrs to fix

    Method load0 has 81 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static void load0() throws java.io.IOException {
            final XMLResourcesLocator locator = Utils.getXMLResourcesLocator();
    
            //1. parse config.xml
            final ConfigParser parser = new ConfigParser();
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/DefinitionLoaders.java - About 3 hrs to fix

      Function Sizzle has 81 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function Sizzle( selector, context, results, seed ) {
          var m, i, elem, nid, match, groups, newSelector,
              newContext = context && context.ownerDocument,
      
              // nodeType defaults to 9, since context defaults to document
      Severity: Major
      Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 3 hrs to fix

        File Wpds.java has 300 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

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

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

                  public void render(final Row row, final Object data, final int index) {
                      final Rows rows = (Rows) row.getParent();
                      final Grid grid = (Grid) rows.getParent();
                      Template tm = getTemplate(grid, rows, "model");
                      GroupingInfo info = null;
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/impl/GridDataLoader.java - About 3 hrs to fix

            File transform.js has 300 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            // jscodeshift can take a parser, like "babel", "babylon", "flow", "ts", or "tsx"
            // Read more: https://github.com/facebook/jscodeshift#parser
            export const parser = 'tsx';
            
            // styles:
            Severity: Minor
            Found in eslint-plugin-zk/src/transform.js - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language