Showing 4,841 of 7,782 total issues

Datebox has 51 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Datebox extends DateTimeFormatInputElement {

    private static final Logger log = LoggerFactory.getLogger(Datebox.class);
    public static final String DEFAULT_FORMAT = "yyyy/MM/dd";

Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Datebox.java - About 7 hrs to fix

    Method jjMoveNfa_0 has 178 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    private int jjMoveNfa_0(int startState, int curPos)
    {
       int startsAt = 0;
       jjnewStateCnt = 8;
       int i = 1;
    Severity: Major
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParserTokenManager.java - About 7 hrs to fix

      Function treemap has 178 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      d3.layout.treemap = function() {
        var hierarchy = d3.layout.hierarchy(),
            round = Math.round,
            size = [1, 1], // width, height
            padding = null,
      Severity: Major
      Found in zktest/src/main/webapp/js/d3.layout.js - About 7 hrs to fix

        Function Deferred has 178 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Deferred: function( func ) {
                var tuples = [
        
                        // action, add listener, callbacks,
                        // ... .then handlers, argument index, [final state]
        Severity: Major
        Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 7 hrs to fix

          File SAXHandler.java has 463 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* SAXHandler.java
          
          
              Purpose:
              Description:
          Severity: Minor
          Found in zcommon/src/main/java/org/zkoss/idom/input/SAXHandler.java - About 7 hrs to fix

            Method toString has a Cognitive Complexity of 46 (exceeds 5 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: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/sys/JSCumulativeContentRenderer.java - About 7 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 optimizeNativeInfos has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                private static void optimizeNativeInfos(NativeInfo compInfo) {
                    //Optimize 1: merge to prolog, if the first children are
                    //native and have no child
                    for (Iterator it = compInfo.getChildren().iterator(); it.hasNext();) {
                        final NodeInfo o = (NodeInfo) it.next();
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 7 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 addAttribute has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                private void addAttribute(ComponentInfo compInfo, Namespace attrns, String name, String value, ConditionImpl cond,
                        org.zkoss.xml.Locator xl) throws Exception {
                    if (Events.isValid(name)) {
                        boolean bZkAttr = attrns == null;
                        if (!bZkAttr) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/ui/metainfo/Parser.java - About 7 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 addPropertyLoadBindings0 has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                private void addPropertyLoadBindings0(Component comp, String attr, String loadExpr, String[] beforeCmds,
                        String[] afterCmds, Map<String, Object> bindingArgs, String converterExpr,
                        Map<String, Object> converterArgs) {
                    final boolean prompt = isPrompt(beforeCmds, afterCmds);
                    final BindingExecutionInfoCollector collector = getBindingExecutionInfoCollector();
            Severity: Minor
            Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 7 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 group has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean group(boolean ascending) {
                    final String dir = getSortDirection();
                    if (ascending) {
                        if ("ascending".equals(dir))
                            return false;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Column.java - About 7 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 group has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                public boolean group(boolean ascending) {
                    final String dir = getSortDirection();
                    if (ascending) {
                        if ("ascending".equals(dir))
                            return false;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Listheader.java - About 7 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 updateVisibleCount has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
            Open

                private void updateVisibleCount(Row row, boolean isRemove) {
                    if (row instanceof Group || row.isVisible()) {
                        final Group g = getGroup(row.getIndex());
            
                        // We shall update the number of the visible item in the following cases.
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/Rows.java - About 7 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 yylex has 176 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public Yytoken yylex() throws java.io.IOException, ParseException {
                int zzInput;
                int zzAction;
            
                // cached fields:
            Severity: Major
            Found in zcommon/src/main/java/org/zkoss/json/parser/Yylex.java - About 7 hrs to fix

              File Treeitem.java has 460 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

                File ExecutionImpl.java has 459 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

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

                  ComponentDefinitionImpl has 50 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class ComponentDefinitionImpl implements ComponentDefinition, java.io.Serializable {
                      private String _name;
                      private transient LanguageDefinition _langdef;
                      private transient PageDefinition _pgdef;
                      private EvaluatorRef _evalr;

                    Method prepare has 173 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        @SuppressWarnings("unchecked")
                        private void prepare(Object o, final int begin) {
                            if (begin > 0 && (o instanceof List)) {
                                final List l = (List) o;
                                final int size = l.size();
                    Severity: Major
                    Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 6 hrs to fix

                      Method mapChildren has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected void mapChildren(DesktopCtrl desktopCtrl, List<String> uuids, List<String[]> idmap, List<Object[]> evtmap,
                                  Component comp) {
                              for (Component p = comp.getFirstChild(); p != null; p = p.getNextSibling()) {
                                  if (p instanceof StubsComponent) {
                                      final String[] kiduuids = ((StubsComponent) p)._uuids;
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.java - About 6 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 addForwards has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public static void addForwards(Component comp, Object controller, char separator) {
                              final Class cls = controller.getClass();
                              final Method[] mtds = cls.getMethods();
                              for (int j = 0; j < mtds.length; ++j) {
                                  final Method md = mtds[j];
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/util/ConventionWires.java - About 6 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 getVisibleItemsDFS has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private <T extends Component> boolean getVisibleItemsDFS(List<T> list, Map<Treeitem, Boolean> map, int[] data) {
                              for (T cmp : list) {
                                  if (cmp instanceof Treeitem) {
                                      if (data[4] >= data[0])
                                          return false; // full
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/Tree.java - About 6 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