Showing 7,775 of 7,775 total issues

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

  final public void FloatingPoint() throws ParseException {
                                       /*@bgen(jjtree) FloatingPoint */
                                        AstFloatingPoint jjtn000 = new AstFloatingPoint(JJTFLOATINGPOINT);
                                        boolean jjtc000 = true;
                                        jjtree.openNodeScope(jjtn000);Token t = null;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 4 other locations - About 1 hr to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 86..101
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1808..1823
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1976..1991
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1997..2012

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 97.

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 5 locations. Consider refactoring.
Open

  final public void LiteralExpression() throws ParseException {
                                               /*@bgen(jjtree) LiteralExpression */
                                                AstLiteralExpression jjtn000 = new AstLiteralExpression(JJTLITERALEXPRESSION);
                                                boolean jjtc000 = true;
                                                jjtree.openNodeScope(jjtn000);Token t = null;
Severity: Major
Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java and 4 other locations - About 1 hr to fix
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1808..1823
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1955..1970
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1976..1991
zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java on lines 1997..2012

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 97.

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

    /* package */DataLoader getDataLoader() {
        if (_dataLoader == null) {
            _rod = evalRod();
            final String loadercls = Library.getProperty("org.zkoss.zul.listbox.DataLoader.class");
            try {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Listbox.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Grid.java on lines 1538..1551

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 97.

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

    /*package*/ DataLoader getDataLoader() {
        if (_dataLoader == null) {
            _rod = evalRod();
            final String loadercls = Library.getProperty("org.zkoss.zul.grid.DataLoader.class");
            try {
Severity: Major
Found in zul/src/main/java/org/zkoss/zul/Grid.java and 1 other location - About 1 hr to fix
zul/src/main/java/org/zkoss/zul/Listbox.java on lines 3046..3059

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 97.

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

    function localeWeekdaysShort(m) {
        return m === true
            ? shiftWeekdays(this._weekdaysShort, this._week.dow)
            : m
            ? this._weekdaysShort[m.day()]
Severity: Major
Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/ext/moment.js on lines 1565..1571

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 64.

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

    function localeWeekdaysMin(m) {
        return m === true
            ? shiftWeekdays(this._weekdaysMin, this._week.dow)
            : m
            ? this._weekdaysMin[m.day()]
Severity: Major
Found in zk/src/main/resources/web/js/zk/ext/moment.js and 1 other location - About 1 hr to fix
zk/src/main/resources/web/js/zk/ext/moment.js on lines 1557..1563

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 64.

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 next has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private static final Token
    next(String src, String delimiters, int j, boolean whitespaceAware,
    boolean parenthesis) {
        final StringBuffer tksb = new StringBuffer(64);
        final int len = src.length();
Severity: Minor
Found in zcommon/src/main/java/org/zkoss/util/Maps.java - About 1 hr to fix

    Method message has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static final String
        message(short code, String extraMsg, Locator loc) {
            StringBuffer sb = new StringBuffer(64);
            switch (code) {
            case HIERARCHY_REQUEST_ERR:
    Severity: Minor
    Found in zcommon/src/main/java/org/zkoss/idom/DOMException.java - About 1 hr to fix

      Method parseByName has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static final NameInfo parseByName(String pattern) {
              final Map<String,Integer> names = new LinkedHashMap<String,Integer>();
              final int len = pattern.length();
              final StringBuffer sb = new StringBuffer(len + 32);
              int j = 0;
      Severity: Minor
      Found in zcommon/src/main/java/org/zkoss/text/MessageFormats.java - About 1 hr to fix

        Method checkCharacterData has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static final void checkCharacterData(String text, Locator loc) {
                if (text == null)
                    throw new DOMException(DOMException.INVALID_CHARACTER_ERR,
                        "A null is not a legal XML value", loc);
        
        
        Severity: Minor
        Found in zcommon/src/main/java/org/zkoss/idom/Verifier.java - About 1 hr to fix

          Method ExpandBuff has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            protected void ExpandBuff(boolean wrapAround)
            {
              char[] newbuffer = new char[bufsize + 2048];
              int newbufline[] = new int[bufsize + 2048];
              int newbufcolumn[] = new int[bufsize + 2048];
          Severity: Minor
          Found in zel/src/main/java/org/zkoss/zel/impl/parser/SimpleCharStream.java - About 1 hr to fix

            Method getValue has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public Object getValue(EvaluationContext ctx)
                        throws ELException {
                    Object obj = this.children[0].getValue(ctx);
            
                    if (obj == null) {
            Severity: Minor
            Found in zel/src/main/java/org/zkoss/zel/impl/parser/AstNegative.java - About 1 hr to fix

              Method Choice has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                final public void Choice() throws ParseException {
                  Or();
                  label_6:
                  while (true) {
                    if (jj_2_5(3)) {
              Severity: Minor
              Found in zel/src/main/java/org/zkoss/zel/impl/parser/ELParser.java - About 1 hr to fix

                Method wireVariables has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        private void wireVariables(final PsdoCompFunctor functor, final List<VariableResolver> resolvers) {
                            Class<?> ctrlClass = _controller.getClass();
                            // wire to fields
                            Reflections.forFields(ctrlClass, WireVariable.class, new FieldRunner<WireVariable>() {
                                public void onField(Class<?> clazz, Field field, WireVariable anno) {
                Severity: Minor
                Found in zk/src/main/java/org/zkoss/zk/ui/select/Selectors.java - About 1 hr to fix

                  Method inRange has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static Direction inRange(HtmlShadowElement se, Component target) {
                          Component hostIfAny = se.getShadowHostIfAny();
                          Map<Component, Integer> oldCacheMap = se.getIndexCacheMap(hostIfAny);
                          final boolean destroyCacheMap = oldCacheMap == null;
                          try {
                  Severity: Minor
                  Found in zk/src/main/java/org/zkoss/zk/ui/HtmlShadowElement.java - About 1 hr to fix

                    Method updateByClient has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected void updateByClient(String name, Object value) {
                            Object o = getAttribute("org.zkoss.zk.ui.updateByClient");
                            if (!(o instanceof Boolean && ((Boolean) o).booleanValue()) && !(o instanceof String && "true".equals(o))) {
                                log.warn("Ignore update of " + name + "=" + value + " from client for " + this.getClass());
                                return; //ignored
                    Severity: Minor
                    Found in zk/src/main/java/org/zkoss/zk/ui/AbstractComponent.java - About 1 hr to fix

                      Method addResponsesForCreatedPerSiblings has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static void addResponsesForCreatedPerSiblings(List<AuResponse> responses, Set<Component> newsibs,
                                  Map<Component, Set<? extends Component>> croppingInfos) throws IOException {
                              final Component parent;
                              final Page page;
                              {
                      Severity: Minor
                      Found in zk/src/main/java/org/zkoss/zk/ui/impl/UiVisualizer.java - About 1 hr to fix

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

                            @SuppressWarnings({ "rawtypes", "unchecked" })
                            public Object coerceToUi(Object val, C comp, BindContext ctx) {
                                if (val == null) {
                                    val = new ArrayList();
                                }

                          Method invokeMethod has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public void invokeMethod(Binder binder, Map<String, Object> bindingArgs, Event triggeringEvent, boolean notifyChange) {
                          
                                  Component rootComp = binder.getView();
                                  Object viewModel = rootComp.getAttribute(VM);
                          
                          

                            Method processCommandBinding has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private void processCommandBinding(Component comp, String propName) {
                                    final ComponentCtrl compCtrl = (ComponentCtrl) comp;
                                    final Collection<Annotation> anncol = compCtrl.getAnnotations(propName, COMMAND_ANNO);
                                    if (anncol.size() == 0)
                                        return;
                            Severity: Minor
                            Found in zkbind/src/main/java/org/zkoss/bind/impl/AnnotateBinderHelper.java - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language