Showing 4,841 of 7,782 total issues

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

    private void afterPageAttached(Page page, Desktop desktop) {
        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 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 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 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 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 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 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 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 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 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 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 setProlog has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static final void setProlog(CreateInfo ci, Component comp, NativeInfo compInfo) {
        final Native nc = (Native) comp;
        final Native.Helper helper = nc.getHelper();
        StringBuffer sb = null;
        final List<NodeInfo> prokids = compInfo.getPrologChildren();
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 addAuExtension has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static final AuExtension addAuExtension(WebApp wapp, String prefix, AuExtension extension)
            throws ServletException {
        DHtmlUpdateServlet upsv = DHtmlUpdateServlet.getUpdateServlet(wapp);
        if (upsv == null) {
            synchronized (DHtmlUpdateServlet.class) {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.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 getFileuploadMetaPerWebApp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    private static  Map<String, Object> getFileuploadMetaPerWebApp(WebApp webApp) {
        final Map<String, Object> params = new HashMap<String, Object>();

        final Configuration conf = webApp.getConfiguration();
        int thrs = conf.getFileSizeThreshold();
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

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

    public void sendRedirect(String uri, boolean respRedirect) {
        if (!respRedirect) {
            sendRedirect(uri);
            return;
        } else {
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/ui/impl/AbstractExecution.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

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

    public static final AuExtension getAuExtension(WebApp wapp, String prefix) {
        DHtmlUpdateServlet upsv = DHtmlUpdateServlet.getUpdateServlet(wapp);
        if (upsv == null) {
            synchronized (DHtmlUpdateServlet.class) {
                upsv = DHtmlUpdateServlet.getUpdateServlet(wapp);
Severity: Minor
Found in zk/src/main/java/org/zkoss/zk/au/http/DHtmlUpdateServlet.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