Showing 7,775 of 7,775 total issues

Method addListener has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void addListener(Object listener) {
        boolean added = false;
        if (listener instanceof EventInterceptor) {
            _eis.addEventInterceptor((EventInterceptor) listener);
            added = true;
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 resolveFunction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public Function resolveFunction(String prefix, String name) throws XelException {
            if (_mappers != null) {
                for (Iterator<FunctionMapper> it = CollectionsX.comodifiableIterator(_mappers); it.hasNext();) {
                    final Function f = it.next().resolveFunction(prefix, name);
                    if (f != null)
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 35 mins 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 beforeSendEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Event beforeSendEvent(Event event) {
        final EventInterceptor[] eis = _eis;
        if (eis != null) {
            for (int j = 0; j < eis.length; ++j) {
                event = eis[j].beforeSendEvent(event);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.java - About 35 mins 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 afterPageDetached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void afterPageDetached(Page page, Desktop prevdesktop) {
        if (_uiCycles != null) {
            for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                final UiLifeCycle listener = it.next();
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 doBeforeComposeChildren has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ void doBeforeComposeChildren(Component comp, boolean bRoot) throws Exception {
        if (_composerExts != null)
            for (Composer composer : _composerExts) {
                final boolean old = beforeInvoke(composer, bRoot);
                UiEngineImpl.doBeforeComposeChildren((ComposerExt) composer, comp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/CreateInfo.java - About 35 mins 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 beforeProcessEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Event beforeProcessEvent(Event event) {
        final EventInterceptor[] eis = _eis;
        if (eis != null) {
            for (int j = 0; j < eis.length; ++j) {
                event = eis[j].beforeProcessEvent(event);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.java - About 35 mins 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 doFinally has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    /*package*/ void doFinally(boolean bRoot) throws Exception {
        if (_composerExts != null)
            for (Composer composer : _composerExts) {
                final boolean old = beforeInvoke(composer, bRoot);

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

    private boolean removeListener0(List list, Object listener) {
        //Since 3.0.6: To be consistent with Configuration,
        //use equals instead of ==
        if (list != null && listener != null)
            for (Iterator it = list.iterator(); it.hasNext();) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 beforePostEvent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Event beforePostEvent(Event event) {
        final EventInterceptor[] eis = _eis;
        if (eis != null) {
            for (int j = 0; j < eis.length; ++j) {
                event = eis[j].beforePostEvent(event);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/EventInterceptors.java - About 35 mins 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 newDesktop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public Desktop newDesktop(RequestInfo ri, String updateURI, String resourceURI, String path) {
        String deviceType = null;
        if (path != null) { //convert to directory
            //though UiEngine.execNewPage will set the device type later,
            //we 'guess' a value first by use of the extension
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractUiFactory.java - About 35 mins 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 doAfterCompose has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    @SuppressWarnings("unchecked")
    /*package*/ void doAfterCompose(Component comp, boolean bRoot) throws Exception {
        if (_composers != null)
            for (Composer composer : _composers) {
                final boolean old = beforeInvoke(composer, bRoot);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/CreateInfo.java - About 35 mins 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 afterComponentMoved has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void afterComponentMoved(Component parent, Component child, Component prevparent) {
        if (_uiCycles != null) {
            for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                final UiLifeCycle listener = it.next();
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 afterComponentAttached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void afterComponentAttached(Component comp, Page page) {
        if (_uiCycles != null) {
            for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                final UiLifeCycle listener = it.next();
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 getNextUuid has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public String getNextUuid(Component comp) {
        final IdGenerator idgen = ((WebAppCtrl) _wapp).getIdGenerator();
        String uuid = null;
        if (idgen != null) {
            try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 clearInInvalidPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void clearInInvalidPage(Collection<Component> coll) {
        for (Iterator<Component> it = coll.iterator(); it.hasNext();) {
            final Component comp = it.next();
            final Page page = comp.getPage();
            if (page != null && ((_pgRemoved != null && _pgRemoved.contains(page))
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 35 mins 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 getClassNames has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

        public Collection<String> getClassNames() {
            Collection<String> coll = null;
            if (_mappers != null) {
                for (Iterator it = CollectionsX.comodifiableIterator(_mappers); it.hasNext();) {
                    final FunctionMapper mapper = (FunctionMapper) it.next();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/PageImpl.java - About 35 mins 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 afterComponentDetached has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public void afterComponentDetached(Component comp, Page prevpage) {
        if (_uiCycles != null) {
            for (Iterator<UiLifeCycle> it = new LinkedList<UiLifeCycle>(_uiCycles).iterator(); it.hasNext();) {
                final UiLifeCycle listener = it.next();
                try {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/DesktopImpl.java - About 35 mins 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 setEpilog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static final void setEpilog(CreateInfo ci, Component comp, NativeInfo compInfo) {
        final Native nc = (Native) comp;
        final Native.Helper helper = nc.getHelper();
        StringBuffer sb = null;
        final NativeInfo splitInfo = compInfo.getSplitChild();
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 35 mins 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 recycleEventThread has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private void recycleEventThread(EventProcessingThreadImpl evtthd) {
        if (!evtthd.isCeased()) {
            if (evtthd.isIdle()) {
                final int max = _wapp.getConfiguration().getMaxSpareThreads();
                synchronized (_idles) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 35 mins 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 getFileuploadMetaPerComp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static Map<String, Object> getFileuploadMetaPerComp(Map<String, Object> params, Desktop desktop, String uuid) {

        // stateless may not have comp at server.
        Component comp = desktop.getComponentByUuidIfAny(uuid);
        if (comp != null) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/AuMultipartUploader.java - About 35 mins 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