Showing 7,775 of 7,775 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (tabscroll) {
                out.push(
                    '<div id="', uuid, '-up" class="', /*safe*/ icon, ' ', this.$s('up-scroll'), '">', domIconHTML('up'), '</div>',
                    '<div id="', uuid, '-down" class="', /*safe*/ icon, ' ', this.$s('down-scroll'), '">', domIconHTML('down'), '</div>');
            }
Severity: Major
Found in zul/src/main/resources/web/js/zul/tab/mold/tabbox.js and 1 other location - About 1 hr to fix
zul/src/main/resources/web/js/zul/tab/mold/tabbox.js on lines 40..44

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

        if (tabscroll) {
            out.push(
                '<div id="', uuid, '-left" class="', /*safe*/ icon, ' ', this.$s('left-scroll'), '">', domIconHTML('left'), '</div>',
                '<div id="', uuid, '-right" class="', /*safe*/ icon, ' ', this.$s('right-scroll'), '">', domIconHTML('right'), '</div>');
        }
Severity: Major
Found in zul/src/main/resources/web/js/zul/tab/mold/tabbox.js and 1 other location - About 1 hr to fix
zul/src/main/resources/web/js/zul/tab/mold/tabbox.js on lines 53..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (ids = dt._pfDoneIds) {
                if (fetchHeaders) fetchHeaders['ZK-Client-Complete'] = ids;
                if (ws) {
                    zWs.setRequestHeaders('ZK-Client-Complete', ids);
                }
Severity: Major
Found in zk/src/main/resources/web/js/zk/au.ts and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/au.ts on lines 1069..1075

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            var indicator = this.$n('hor-indicator'),
                wwdh = wrapper.offsetWidth,
                iwdh = Math.round(wwdh * wdh / swdh),
                iwdh = iwdh > 15 ? iwdh : 15;
Severity: Major
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 1 hr to fix
zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 302..305

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            if (ids = dt._pfRecvIds) {
                if (fetchHeaders) fetchHeaders['ZK-Client-Receive'] = ids;
                if (ws) {
                    zWs.setRequestHeaders('ZK-Client-Receive', ids);
                }
Severity: Major
Found in zk/src/main/resources/web/js/zk/au.ts and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/au.ts on lines 1076..1082

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            var indicator = this.$n('ver-indicator'),
                whgh = wrapper.offsetHeight,
                ihgh = Math.round(whgh * hgh / shgh),
                ihgh = ihgh > 15 ? ihgh : 15;
Severity: Major
Found in zul/src/main/resources/web/js/zul/Scrollbar.ts and 1 other location - About 1 hr to fix
zul/src/main/resources/web/js/zul/Scrollbar.ts on lines 247..250

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 60.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method write has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public void write(int b) throws IOException {
        if (_type != 0) {
            if (!"UTF-8".equals(_charset) || (b & 0xc0) == 0x80) {
                _bs[_cnt ++] = (byte)b;
                if (_cnt == _type) { //complete
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/io/WriterOutputStream.java - About 1 hr to fix

    Method init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public void init() throws ServletException {
            final ServletContext ctx = getServletContext();
            final ServletConfig config = getServletConfig();
            String param = config.getInitParameter("compress");
            if (param != null)

      Method setValue has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public void setValue(ELContext context, Object base, Object property,
                  Object value) {
      
              if (context == null) {
                  throw new NullPointerException();
      Severity: Minor
      Found in zel/src/main/java/org/zkoss/zel/BeanNameELResolver.java - About 1 hr to fix

        Method getType has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public Class<?> getType(ELContext context, Object base, Object property) {
                if (context == null) {
                    throw new NullPointerException();
                }
        
        Severity: Minor
        Found in zel/src/main/java/org/zkoss/zel/StaticFieldELResolver.java - About 1 hr to fix

          Method visit has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public void visit(Node node) throws ELException {
                  if (node instanceof AstFunction) {
          
                      AstFunction funcNode = (AstFunction) node;
          
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/impl/lang/ExpressionBuilder.java - About 1 hr to fix

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

                    public void render(Listitem item, Object obj, int index)
                            throws Exception {
                        if (item instanceof Listgroup) {
                            FoodGroupInfo groupInfo = (FoodGroupInfo) obj;
                            Food food = groupInfo.getFirstChild();

              Method filterOutShadows has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static final Component[] filterOutShadows(Component[] shadows) {
                      if (shadows == null || shadows.length == 0)
                          return shadows;
                      int length = shadows.length;
              
              Severity: Minor
              Found in zk/src/main/java/org/zkoss/zk/ui/sys/ShadowElementsCtrl.java - About 1 hr to fix

                Method outZkTags has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static String outZkTags(Execution exec, WebApp wapp, String deviceType) {
                        if (exec.getAttribute(ATTR_ZK_TAGS_GENERATED) != null)
                            return null;
                        exec.setAttribute(ATTR_ZK_TAGS_GENERATED, Boolean.TRUE);
                
                
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/sys/HtmlPageRenders.java - About 1 hr to fix

                  Method remove0 has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private boolean remove0(String name, Scope ctxscope) {
                          Map<String, EventQueue> eqs;
                          Object ctxLock = Scopes.getLockForScopeIfAny(ctxscope);
                  
                          synchronized (ctxLock) {

                    Method handleError has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private void handleError(Session sess, RenderRequest request, RenderResponse response, String path, Throwable err,
                                String msg) throws PortletException, IOException {
                            // ZK-3679
                            Throwable cause;
                            if (err instanceof OperationException && (cause = err.getCause()) instanceof Expectable)
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/http/DHtmlLayoutPortlet.java - About 1 hr to fix

                      Method recycleDesktop has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public void recycleDesktop(Execution exec, Page page, Writer out) throws IOException {
                              PerformanceMeter pfmeter = page.getDesktop().getWebApp().getConfiguration().getPerformanceMeter();
                              final long startTime = pfmeter != null ? System.currentTimeMillis() : 0;
                              final String pfReqId = pfmeter != null ? meterLoadStart(pfmeter, exec, startTime) : null;
                      
                      
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiEngineImpl.java - About 1 hr to fix

                        Method getVariableImpl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                protected Variable getVariableImpl(String name, boolean recurse) throws UtilEvalError {
                                    //Note: getVariableImpl returns null if not defined,
                                    //while getVariable return Primitive.VOID if not defined
                        
                                    //Tom M Yeh: 20060606:
                        Severity: Minor
                        Found in zk/src/main/java/org/zkoss/zk/scripting/bsh/BSHInterpreter.java - About 1 hr to fix

                          Method coerceToUi has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public Object coerceToUi(Object val, Component comp, BindContext ctx) {
                                  Tree tree = (Tree) comp;
                                  final TreeModel<Object> model = tree.getModel();
                          
                                  if (model != null && !(model instanceof TreeSelectableModel)) {

                            Method load has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public void load(BindContext ctx) {
                                    final Component comp = getComponent(); //ctx.getComponent();
                                    final BindEvaluatorX eval = getBinder().getEvaluatorX();
                                    final BindingExecutionInfoCollector collector = ((BinderCtrl) getBinder()).getBindingExecutionInfoCollector();
                            
                            
                              Severity
                              Category
                              Status
                              Source
                              Language