Showing 4,841 of 7,782 total issues

Method getType has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public Class<?> getType(ELContext context, Object base, Object property) {
        context.setPropertyResolved(false);
        int sz = this.size;
        Class<?> type;
        for (int i = 0; i < sz; i++) {
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/CompositeELResolver.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 jj_rescan_token has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

  private void jj_rescan_token() {
    jj_rescan = true;
    for (int i = 0; i < 8; i++) {
    try {
      JJCalls p = jj_2_rtns[i];
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.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 getExpressionFactory has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    static ExpressionFactory getExpressionFactory() {

        ClassLoader tccl = ClassUtil.getContextClassLoader(Util.class);
        CacheValue cacheValue = null;
        ExpressionFactory factory = null;
Severity: Minor
Found in zel/src/main/java/org/zkoss/zel/Util.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 append has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static void append(StringBuffer sb, JavaScript js) {
        sb.append("\n<script type=\"text/javascript\"");
        if (js.getSrc() != null) {
            String url;
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 outSpecialJS has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static final String outSpecialJS(Desktop desktop) {
        final StringBuffer sb = new StringBuffer();

        //output application name
        String oldnm = (String) desktop.getAttribute(ATTR_APPNM);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.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 service has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public void service(Event event, Scope scope) throws Exception {
        final StubEvent stubevt = event instanceof StubEvent ? (StubEvent) event : null;
        final String uuid = stubevt != null ? stubevt.getUuid() : null;
        if (uuid == null || uuid.equals(getUuid())) {
            super.service(event, scope);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/sys/StubsComponent.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 resolveDefineComponents has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private void resolveDefineComponents(Collection<Component> comps, Map<String, Component> map) {
        if (!comps.isEmpty()) {
            Component comp = comps.iterator().next();
            // join "define" components as children of "insert" component
            do {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/util/Composition.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 close has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        private void close() {
            _que.close();
            _desktop.removeListener(_cleanup);
            _desktop.removeListener(_service);
            if (_spEnabled) {

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 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected void process(HttpServletRequest request, HttpServletResponse response, String content)
            throws ServletException, IOException {
        if (log.isDebugEnabled())
            log.debug("Content to filter:\n{}", content);

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutFilter.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 findResourcePath has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private String findResourcePath(RequestContext reqctx, OutputStream out, String path, String dir, boolean locate, boolean write) throws ServletException, IOException {
        if (path.startsWith("~./")) path = path.substring(2);
        else if (path.charAt(0) != '/') path = Files.normalize(dir, path);
        //source map browser issue and check source map file is available or not
        String originalPath = "";
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/WpdExtendlet.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 getFirstDayOfWeek has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public static final int getFirstDayOfWeek(Session sess) {
        int firstDayOfWeek = -1;
        try {
            Object o = null;
            if (sess != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/http/Utils.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 shrinkRange has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    protected void shrinkRange(Component firstChild, Component lastChild) {
        if (firstChild != null) { // has children
            boolean isEdge = false;
            if (firstChild == _firstInsertion) { // cut edge
                if (lastChild == _lastInsertion) { // cut all
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.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 getUuid has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public String getUuid() {
        if (_uuid == null) {
            Execution exec = null; // ZK-2606: if parent has _page, child is in the same component tree
            for (Component comp = this; comp != null; comp = comp.getParent()) {
                if (comp.getPage() != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 clone has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public Object clone() {
            final AuxInfo clone;
            try {
                clone = (AuxInfo) super.clone();
            } catch (CloneNotSupportedException e) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.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 removeListener has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public boolean removeListener(Object listener) {
        boolean found = false;
        if (listener instanceof EventInterceptor && _eis.removeEventInterceptor((EventInterceptor) listener))
            found = true;

Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.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 writeObject has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private synchronized void writeObject(java.io.ObjectOutputStream s) throws java.io.IOException {
        s.defaultWriteObject();

        s.writeObject(_langdef != null ? _langdef.getName() : null);
        s.writeObject(_owner != null ? _owner.getUuid() : null);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.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 wait has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public void wait(Object mutex) throws InterruptedException, SuspendNotAllowedException {
        if (mutex == null)
            throw new IllegalArgumentException("null mutex");

        final Thread thd = Thread.currentThread();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 create has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

        public Component[] create(Component parent, Component insertBefore, VariableResolver resolver,
                Composer composer) {
            final Execution exec = Executions.getCurrent();
            final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
            final Component[] cs;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 endUpdate has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    public void endUpdate(Execution exec) throws IOException {
        final Desktop desktop = exec.getDesktop();
        final DesktopCtrl desktopCtrl = (DesktopCtrl) desktop;
        final Configuration config = desktop.getWebApp().getConfiguration();
        final ExecutionCtrl execCtrl = (ExecutionCtrl) exec;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.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 getCharset has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    private static String getCharset(String ctype) {
        final String ctypelc = ctype.toLowerCase(java.util.Locale.ENGLISH);
        for (int j = 0; (j = ctypelc.indexOf("charset", j)) >= 0; j += 7) {
            int k = org.zkoss.lang.Strings.skipWhitespacesBackward(ctype, j - 1);
            if (k < 0 || ctype.charAt(k) == ';') {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.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