Showing 4,841 of 7,782 total issues

Method write has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

        private Method write(ELContext ctx) {
            if (this.write == null) {
                this.write = Util.getMethod(this.owner, descriptor.getWriteMethod());
                
                //20110921, henrichen: Introspector is too strict for Setter(must return void), here we loosen it
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/BeanELResolver.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 jjMoveStringLiteralDfa1_1 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

private int jjMoveStringLiteralDfa1_1(long active0)
{
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_1(0, active0);
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.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 jjMoveStringLiteralDfa1_2 has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

private int jjMoveStringLiteralDfa1_2(long active0)
{
   try { curChar = input_stream.readChar(); }
   catch(java.io.IOException e) {
      jjStopStringLiteralDfa_2(0, active0);
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.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 LambdaExpression has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  final public void LambdaExpression() throws ParseException {
                                             /*@bgen(jjtree) LambdaExpression */
  AstLambdaExpression jjtn000 = new AstLambdaExpression(JJTLAMBDAEXPRESSION);
  boolean jjtc000 = true;
  jjtree.openNodeScope(jjtn000);
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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 resolveAmbiguousMethod has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private static Method resolveAmbiguousMethod(Set<Method> candidates,
            Class<?>[] paramTypes) {
        // Identify which parameter isn't an exact match
        Method m = candidates.iterator().next();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/util/ReflectionUtil.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 resolveAmbiguousWrapper has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private static Wrapper resolveAmbiguousWrapper(Set<Wrapper> candidates,
            Class<?>[] paramTypes) {
        // Identify which parameter isn't an exact match
        Wrapper w = candidates.iterator().next();
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 append has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private static void append(StringBuffer sb, StyleSheet ss, Execution exec, Page page) {
        String href = ss.getHref();
        String media = ss.getMedia();
        if (href != null) {
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 toByteArray has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

        @SuppressWarnings("unchecked")
        private byte[] toByteArray(RequestContext reqctx) throws ServletException, IOException {
            final ByteArrayOutputStream out = new ByteArrayOutputStream();
            final HttpServletRequest request = reqctx.request;
            final String main = request != null ? request.getParameter("main") : null;
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 injectComponent has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

        @SuppressWarnings("unchecked")
        private void injectComponent(InjectionFunctor injector, Iterable<Component> comps) {
            Class<?> type = injector.getType();
            boolean isField = injector instanceof FieldFunctor;
            // Array
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.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 process has a Cognitive Complexity of 25 (exceeds 5 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: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.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 componentToPath has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String componentToPath(Component comp, Component ref) {
        //Implementation Note:
        //The path being written is a bit different to Path, if ref
        //is not an space owner
        //For example, if comp is the space owner, "" is written.
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/Components.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 parseEvaluatorDirective has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    private static void parseEvaluatorDirective(PageDefinition pgdef, ProcessingInstruction pi,
            Map<String, String> params) throws Exception {
        final String clsnm = params.remove("class");
        if (clsnm != null && clsnm.length() > 0) {
            noELnorEmpty("class", clsnm, pi);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.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 lookup has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public static final LanguageDefinition lookup(String name) {
        init();

        if (name == null || name.length() == 0)
            name = "xul/html";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/LanguageDefinition.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 postPhase has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public void postPhase(Phase phase, BindContext ctx) {
        switch (phase) {
        case COMMAND:
            final String commandName = ctx.getCommandName();
            final Binder binder = ctx.getBinder();

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 25 (exceeds 5 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: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BindTreeitemRenderer.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 hashCode has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    static int hashCode(Object a) {
        if (a == null) {
            return -1;
        }
        if (!a.getClass().isArray()) {
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/KeyFactory.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 ungroup has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public void ungroup(boolean ascending) {
        final Comparator<?> cmpr = ascending ? _sortAsc : _sortDsc;
        if (cmpr != null) {

            final Grid grid = getGrid();
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Column.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 render has a Cognitive Complexity of 25 (exceeds 5 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();
        final int size = grid.getModel().getSize();
        //B70-ZK-2555: in order to handle dynamic template name
Severity: Minor
Found in zkbind/src/main/java/org/zkoss/bind/impl/BindRowRenderer.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 setMold has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public void setMold(String mold) {
        final String old = getMold();
        if (!Objects.equals(old, mold)) {
            super.setMold(mold);
            //we have to change model before detaching paging,
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 compare has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    public int compare(Object o1, Object o2) {
        if (_index < 0 && _column != null) //decide the index
            _index = _column.getParent().getChildren().indexOf(_column);

        Object v1, v2;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/RowComparator.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