Showing 4,841 of 7,782 total issues

Method getTokenType has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            private Type getTokenType(char input, CharClass inputClass) {

                switch (inputClass) {
                case LITERAL:
                    return Type.IDENTIFIER;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/select/impl/Tokenizer.java - About 1 hr to fix

    Method destroy has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void destroy() {
            try {
                _config.invokeWebAppCleanups();
            } catch (Throwable ex) {
                log.warn("Failed to invoke webapp cleanups", ex);
    Severity: Minor
    Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractWebApp.java - About 1 hr to fix

      Method processEvent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public boolean processEvent(Desktop desktop, Component comp, Event event) {
              if (Thread.currentThread() instanceof EventProcessingThreadImpl)
                  throw new IllegalStateException("processEvent cannot be called in an event thread");
              if (_ceased != null)
                  throw new InternalError("The event thread has beeing stopped. Cause: " + _ceased);

        Method setComponent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public void setComponent(Component comp) {
                _component = comp;
                //scope param
                _paramResolvers.put(ScopeParam.class, new ParamResolver<Annotation>() {
        
        
        Severity: Minor
        Found in zkbind/src/main/java/org/zkoss/bind/impl/ParamCall.java - About 1 hr to fix

          Method addChildrenLoadBindings0 has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private void addChildrenLoadBindings0(Component comp, 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();
                  if (prompt) {
          Severity: Minor
          Found in zkbind/src/main/java/org/zkoss/bind/impl/BinderImpl.java - About 1 hr to fix

            Method parseConstraint has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected int parseConstraint(String constraint) throws UiException {
                    if (constraint.equals("no positive"))
                        return NO_POSITIVE;
                    else if (constraint.equals("no negative"))
                        return NO_NEGATIVE;
            Severity: Minor
            Found in zul/src/main/java/org/zkoss/zul/SimpleConstraint.java - About 1 hr to fix

              Method setSelectedIndex has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @SuppressWarnings("rawtypes")
                  public void setSelectedIndex(int jsel) {
                      final int isz = _items.size();
                      final int tsz = _model != null ? _model.getSize() : isz;
                      if (jsel >= tsz)
              Severity: Minor
              Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                Method parseControl has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private static int parseControl(Context ctx, Node parent, int from, int to)
                            throws DspException, IOException, XelException {
                        int j = from + 2;
                        if (j + 1 >= to)
                            throw new DspException(MWeb.DSP_ACTION_NOT_TERMINATED, new Object[] { null, new Integer(ctx.nLines) });
                Severity: Minor
                Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/Parser.java - About 1 hr to fix

                  Method importStatic has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void importStatic(String name) throws org.zkoss.zel.ELException {
                          int lastPeriod = name.lastIndexOf('.');
                  
                          if (lastPeriod < 0) {
                              throw new ELException(Util.message(
                  Severity: Minor
                  Found in zel/src/main/java/org/zkoss/zel/ImportHandler.java - About 1 hr to fix

                    Method getComponent0 has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static final Component getComponent0(IdSpace is, String path) {
                            Component found = null;
                            for (int j = 0, k;; j = k + 1) {
                                k = path.indexOf('/', j);
                    
                    
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/Path.java - About 1 hr to fix

                      Method getNotifys has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static Set<Property> getNotifys(Method m, Object base, String prop, Object value, BindContext ctx) {
                              //TODO, Dennis, do we really need to pass value here?
                              final Set<Property> notifys = new LinkedHashSet<Property>();
                              if (m == null)
                                  return notifys;
                      Severity: Minor
                      Found in zkbind/src/main/java/org/zkoss/bind/xel/zel/BindELContext.java - About 1 hr to fix

                        Method reInitBinder0 has 48 lines of code (exceeds 25 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;

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

                                  /* package */@SuppressWarnings({ "unchecked", "rawtypes" })
                                  void render(Listitem item, int index) throws Throwable {
                                      if (item.isLoaded()) {
                                          return; // nothing to do
                                      }
                          Severity: Minor
                          Found in zul/src/main/java/org/zkoss/zul/Listbox.java - About 1 hr to fix

                            Function select has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            select = Sizzle.select = function( selector, context, results, seed ) {
                                var i, tokens, token, type, find,
                                    compiled = typeof selector === "function" && selector,
                                    match = !seed && tokenize( ( selector = compiled.selector || selector ) );
                            
                            
                            Severity: Minor
                            Found in zk/src/main/resources/web/js/zk/ext/jquery.js - About 1 hr to fix

                              Function configFromStringAndArray has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function configFromStringAndArray(config) {
                                      var tempConfig,
                                          bestMoment,
                                          scoreToBeat,
                                          i,
                              Severity: Minor
                              Found in zk/src/main/resources/web/js/zk/ext/moment.js - About 1 hr to fix

                                Function transformJavadocParam has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        function transformJavadocParam(param: DocParamBlock): void {
                                            const { pos: start, end, buffer } = param.blockTag.getTokenSequence().getContainingTextRange();
                                            uselessParamPattern.lastIndex = end;
                                            if (uselessParamPattern.test(buffer)) {
                                                const lineEnd = uselessParamPattern.lastIndex;
                                Severity: Minor
                                Found in eslint-plugin-zk/src/rules/tsdocValidation.ts - About 1 hr to fix

                                  Method getTextRelevantStyle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static final String getTextRelevantStyle(final String style) {
                                          if (style == null) return null;
                                          if (style.length() == 0) return "";
                                  
                                          final StringBuffer sb = new StringBuffer(64);
                                  Severity: Minor
                                  Found in zcommon/src/main/java/org/zkoss/html/HTMLs.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

                                  Method getSubstyleIndex has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static final int getSubstyleIndex(String style, String substyle) {
                                          if (style == null || substyle == null)
                                              throw new IllegalArgumentException("null");
                                          if (substyle.length() == 0)
                                              throw new IllegalArgumentException("empty substyle");
                                  Severity: Minor
                                  Found in zcommon/src/main/java/org/zkoss/html/HTMLs.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

                                  Method checkNamespacePrefix has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static final void checkNamespacePrefix(String prefix, Locator loc) {
                                          if (prefix == null || prefix.length() == 0)
                                              return; //OK: null or empty
                                  
                                          String reason = null;
                                  Severity: Minor
                                  Found in zcommon/src/main/java/org/zkoss/idom/Verifier.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

                                  Method load has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                      public static final TaglibDefinition load(Element root) throws Exception {
                                          final TaglibDefinition tagdef = new TaglibDefinition();
                                          Exception excp = null;
                                          for (Element e: root.getElements("function")) {
                                              final String name = IDOMs.getRequiredElementValue(e, "name");
                                  Severity: Minor
                                  Found in zcommon/src/main/java/org/zkoss/xel/taglib/Taglibs.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