Showing 4,841 of 7,782 total issues

Method processEvent has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    private void processEvent(Desktop desktop, Component comp, Event event) {
        final Configuration config = desktop.getWebApp().getConfiguration();
        if (config.isEventThreadEnabled()) {
            EventProcessingThreadImpl evtthd = null;
            synchronized (_idles) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 24 (exceeds 5 allowed). Consider refactoring.
Open

    static int compare(Object a, Object b) {
        if (a == b) {
            return 0;
        }
        if (a == null) {
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 addFormSaveBindings0 has a Cognitive Complexity of 24 (exceeds 5 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 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 getAnnotateMethods has a Cognitive Complexity of 24 (exceeds 5 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);

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 parseConstraint has a Cognitive Complexity of 24 (exceeds 5 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 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 insertBefore has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean insertBefore(Component child, Component refChild) {
        if (child instanceof North) {
            if (!super.insertBefore(child, refChild))
                return false;
            _north = (North) child;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/Borderlayout.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 encodeRedirectURL has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String encodeRedirectURL(ServletContext ctx, HttpServletRequest request,
            HttpServletResponse response, String uri, Map params, int mode) {
        if (uri == null) {
            uri = request.getContextPath() + getOriginFullServlet(request);
        } else {
Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/http/Https.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 endOfEL has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    private static int endOfEL(Context ctx, int from, int to) throws DspException {
        for (int j = from + 2;; ++j) {
            if (j >= to)
                throw new DspException(MWeb.EL_NOT_TERMINATED, new Integer(ctx.nLines));

Severity: Minor
Found in zweb/src/main/java/org/zkoss/web/servlet/dsp/impl/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 loadLabels has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    private final Map<String, ExValue> loadLabels(Locale locale) {
        WaitLock lock = null;
        for (;;) {
            final Object o;

    Method parseSystemConfig has 85 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @SuppressWarnings("deprecation")
        private static void parseSystemConfig(Configuration config, Element el) throws Exception {
            String s = el.getElementValue("disable-event-thread", true);
            if (s != null) {
                final boolean enable = "false".equals(s);
    Severity: Major
    Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 3 hrs to fix

      Method getDateJavaScript has 85 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static final String getDateJavaScript(Locale locale, int firstDayOfWeek) {
              final StringBuffer sb = new StringBuffer(512);
              final Calendar cal = Calendar.getInstance(locale);
              final int twoDigitYearStart = Utils.get2DigitYearStart();
              cal.clear();
      Severity: Major
      Found in zk/src/main/java/org/zkoss/zk/ui/http/Wpds.java - About 3 hrs to fix

        Function _mouseDown has 85 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _mouseDown(evt: JQuery.MouseDownEvent<never, never, HTMLElement>): void {
                if (this._pressTimer) {
                    clearInterval(this._pressTimer);
                    this._pressTimer = undefined;
                }
        Severity: Major
        Found in zul/src/main/resources/web/js/zul/Scrollbar.ts - About 3 hrs to fix

          File GroupsListModel.java has 308 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* GroupsListModelImpl.java
          
              Purpose:
                  
              Description:
          Severity: Minor
          Found in zul/src/main/java/org/zkoss/zul/impl/GroupsListModel.java - About 3 hrs to fix

            Method service has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void service(HttpServletRequest request, HttpServletResponse response, String pi)
                        throws ServletException, IOException {
                    //        if (log.isDebugEnabled()) log.debug("View "+pi);
                    final Session sess = Sessions.getCurrent(false);
                    if (sess == null) {
            Severity: Major
            Found in zk/src/main/java/org/zkoss/zk/au/http/AuDynaMediar.java - About 3 hrs to fix

              Method web0 has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private void web0(HttpServletRequest request, HttpServletResponse response, String pi, String ext)
                          throws ServletException, IOException {
                      if (ext != null) {
                          //Invoke the resource processor (Extendlet)
                          final Extendlet extlet = getExtendlet(ext);
              Severity: Major
              Found in zweb/src/main/java/org/zkoss/web/util/resource/ClassWebResource.java - About 3 hrs to fix

                StateMachine has 28 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public abstract class StateMachine<E, C, IN> {
                    
                    protected final Map<E, StateCtx<E, C, IN>> _states = 
                        new HashMap<E, StateCtx<E, C, IN>>();
                    protected E _current;
                Severity: Minor
                Found in zcommon/src/main/java/org/zkoss/fsm/StateMachine.java - About 3 hrs to fix

                  CommonFns has 28 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public class CommonFns {
                      private static final Logger log = LoggerFactory.getLogger(CommonFns.class);
                  
                      protected CommonFns() {}
                  
                  
                  Severity: Minor
                  Found in zcommon/src/main/java/org/zkoss/xel/fn/CommonFns.java - About 3 hrs to fix

                    Va10 has 28 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    public class Va10{
                    
                        private Integer age = 0;
                        private Integer negativeOne = -1;
                        private String keyword;

                      ConfigParser has 28 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class ConfigParser {
                          private static final Logger log = LoggerFactory.getLogger(ConfigParser.class);
                      
                          /** The number of segments in a version.
                           */
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/sys/ConfigParser.java - About 3 hrs to fix

                        Binder has 28 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public interface Binder {
                        
                            /**
                             * Component annotation of ZKBind
                             */
                        Severity: Minor
                        Found in zkbind/src/main/java/org/zkoss/bind/Binder.java - About 3 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language