Showing 4,841 of 7,782 total issues

Method resolveAmbiguousMethod has 44 lines of code (exceeds 25 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 1 hr to fix

    Method getValue has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public Object getValue(EvaluationContext ctx) throws ELException {
            ctx.putContext(AstValue.class, new Integer(this.jjtGetNumChildren()));
            ctx.putContext(Node.class, this.children[0]); //20110905, henrichen: bind property node
            Object base = this.children[0].getValue(ctx);
            ctx.putContext(Node.class, this.children[0]); //20110905, henrichen: bind property node
    Severity: Minor
    Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstValue.java - About 1 hr to fix

      Method resolveAmbiguousWrapper has 44 lines of code (exceeds 25 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 1 hr to fix

        Method toString has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public String toString() {
                if (_type == null && _id == null && _classes.isEmpty() && _pseudoClasses.isEmpty() && _attributes.isEmpty()
                        && _pseudoElements.isEmpty())
                    return "*";
        

          Method next has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public boolean next() {
                  if (_done)
                      throw new IllegalStateException("Iterate twice not allowed");
          
                  if (_status == null) {
          Severity: Minor
          Found in zk/src/main/java/org/zkoss/zk/ui/util/ForEachImpl.java - About 1 hr to fix

            Method unwrap has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public NameSpace unwrap(Scope scope) {
                    if (_bshns == null) {
                        _bshns = BSHInterpreter.getInterpreter(scope).newNS(scope);
                        if (_vars != null) {
                            for (Map.Entry<String, Object> me : _vars.entrySet()) {
            Severity: Minor
            Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/NSWrapSR.java - About 1 hr to fix

              Method getAnnotateMethods has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private List<Method> getAnnotateMethods(Binder binder, Class<T> annotationClass, Class<?> vmClass) {
                      List<Method> methods = null;
                      synchronized (annoMethodCache) {
                          //have to synchronized cache, because it calls expunge when get.
                          methods = annoMethodCache.get(vmClass);

                Method doExecute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected void doExecute(Component comp, String command, Map<String, Object> commandArgs, BindContext ctx,
                            Set<Property> notifys) {
                        try {
                            Matcher matcher = CALL_OTHER_VM_COMMAND_PATTERN.matcher(command);
                            if (matcher.find()) {
                Severity: Minor
                Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

                  Method addFormSaveBindings0 has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private void addFormSaveBindings0(Component comp, String formId, String saveExpr, String[] beforeCmds,
                              String[] afterCmds, Map<String, Object> bindingArgs, String validatorExpr,
                              Map<String, Object> validatorArgs) {
                          final boolean prompt = isPrompt(beforeCmds, afterCmds);
                          if (prompt) {
                  Severity: Minor
                  Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

                    Method service has 44 lines of code (exceeds 25 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);
                    
                    
                    Severity: Minor
                    Found in zul/src/main/java/org/zkoss/zul/Treeitem.java - About 1 hr to fix

                      Method parseFieldNames has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private Collection<FieldInfo> parseFieldNames(String fieldnames, boolean ascending) {
                              final Collection<String> fields = CollectionsX.parse(new ArrayList<String>(), fieldnames, ',');
                              final List<FieldInfo> results = new ArrayList<FieldInfo>(fields.size());
                              for (final Iterator<String> it = fields.iterator(); it.hasNext();) {
                                  final String field = it.next().trim();
                      Severity: Minor
                      Found in zul/src/main/java/org/zkoss/zul/FieldComparator.java - About 1 hr to fix

                        Method removePartial has 44 lines of code (exceeds 25 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 1 hr to fix

                          Function data has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              data: function( key, value ) {
                                  var i, name, data,
                                      elem = this[ 0 ],
                                      attrs = elem && elem.attributes;
                          
                          
                          Severity: Minor
                          Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                            Function leverageNative has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function leverageNative( el, type, expectSync ) {
                            
                                // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add
                                if ( !expectSync ) {
                                    if ( dataPriv.get( el, type ) === undefined ) {
                            Severity: Minor
                            Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                              Function copyConfig has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function copyConfig(to, from) {
                                      var i,
                                          prop,
                                          val,
                                          momentPropertiesLen = momentProperties.length;
                              Severity: Minor
                              Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                                Function defineLocale has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function defineLocale(name, config) {
                                        if (config !== null) {
                                            var locale,
                                                parentConfig = baseConfig;
                                            config.abbr = name;
                                Severity: Minor
                                Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                                  Function dayOfYearFromWeekInfo has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function dayOfYearFromWeekInfo(config) {
                                          var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow, curWeek;
                                  
                                          w = config._w;
                                          if (w.GG != null || w.W != null || w.E != null) {
                                  Severity: Minor
                                  Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                                    Function _parseTextToArray has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function _parseTextToArray(txt: string, fmt: string): string[] | undefined {
                                        //ZK-5423
                                        var literals = extractLiteral(fmt); //extract literal token from format
                                        //remove literal from format and text
                                        fmt = fmt.replace(/'.*?'/g, ' ');  //remove any string enclosed by single quotes
                                    Severity: Minor
                                    Found in zul/src/main/resources/web/js/zul/db/datefmt.ts - About 1 hr to fix

                                      Function scrollToElement has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          scrollToElement(dom: HTMLElement): void {
                                              var cave = this.cave,
                                                  domTop = jq(dom).offset()!.top,
                                                  domBottom = domTop + dom.offsetHeight,
                                                  domLeft = jq(dom).offset()!.left,
                                      Severity: Minor
                                      Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 1 hr to fix

                                        Method toReadable has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            public static final String toReadable(long val, String skips) {
                                                if (skips == null) skips = SKIPS;
                                        
                                                final int mod = 36 - skips.length();
                                        
                                        
                                        Severity: Minor
                                        Found in zcommon/src/main/java/org/zkoss/util/Checksums.java - About 1 hr 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