zul/src/main/java/org/zkoss/zul/DialModelScale.java

Summary

Maintainability
D
2 days
Test Coverage

DialModelScale has 43 methods (exceeds 20 allowed). Consider refactoring.
Open

public class DialModelScale implements Serializable {
    private DialModel _model;

    //data
    private double _value;
Severity: Minor
Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 5 hrs to fix

    Method setScale has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public void setScale(double lowerBound, double upperBound, double startAngle, double extent,
                double majorTickInterval, int minorTickCount) {
    Severity: Minor
    Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

              if (Double.compare(lowerBound, _lowerBound) != 0 || Double.compare(upperBound, _upperBound) != 0
                      || Double.compare(startAngle, _startAngle) != 0 || Double.compare(extent, _extent) != 0
                      || Double.compare(majorTickInterval, _majorTickInterval) != 0
                      || Double.compare(minorTickCount, _minorTickCount) != 0) {
                  _lowerBound = lowerBound;
      Severity: Major
      Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 40 mins to fix

        Method newRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public DialModelRange newRange(double lower, double upper, String color, double innerRadius, double outerRadius) {
        Severity: Minor
        Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java - About 35 mins to fix

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

              public void setNeedleColor(String color) {
                  if (Objects.equals(color, _needleColor)) {
                      return;
                  }
                  _needleColor = color;
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 5 other locations - About 1 hr to fix
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 175..187
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 209..221
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 243..255
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 277..289
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 344..356

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

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

              public void setTickColor(String color) {
                  if (Objects.equals(color, _tickColor)) {
                      return;
                  }
                  _tickColor = color;
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 5 other locations - About 1 hr to fix
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 175..187
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 209..221
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 243..255
          zul/src/main/java/org/zkoss/zul/DialModel.java on lines 277..289
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 440..452

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

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

              public void setTextRadius(double radius) {
                  if (Double.compare(_textRadius, radius) != 0) {
                      _textRadius = radius;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TEXT_RADIUS, radius);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

              public void setValueAngle(double angle) {
                  if (Double.compare(_valueAngle, angle) != 0) {
                      _valueAngle = angle;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_ANGLE, angle);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

              public void setTickLabelOffset(double tickLabelOffset) {
                  if (Double.compare(_tickLabelOffset, tickLabelOffset) != 0) {
                      _tickLabelOffset = tickLabelOffset;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TICK_LABEL_OFFSET, tickLabelOffset);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

              public void setValueRadius(double radius) {
                  if (Double.compare(_valueRadius, radius) != 0) {
                      _valueRadius = radius;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_RADIUS, radius);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

              public void setTickRadius(double radius) {
                  if (Double.compare(_tickRadius, radius) != 0) {
                      _tickRadius = radius;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TICK_RADIUS, radius);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

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

              public void setNeedleRadius(double radius) {
                  if (Double.compare(_needleRadius, radius) != 0) {
                      _needleRadius = radius;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.NEEDLE_RADIUS, radius);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 88..93
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338

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

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

              public void setValue(double val) {
                  if (Double.compare(_value, val) != 0) {
                      _value = val;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_VALUE, val);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 6 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 144..149
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 182..187
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 201..206
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 314..319
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 333..338
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 474..479

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

          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

              public void setValueFont(Font font) {
                  if (!Objects.equals(font, _valueFont)) {
                      _valueFont = font;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.VALUE_FONT, font);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 106..111
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 125..130
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

          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

              public void setText(String text) {
                  if (!Objects.equals(text, _text)) {
                      _text = text;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_TEXT, text);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 125..130
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 163..168
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

          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

              public void setTextFont(Font font) {
                  if (!Objects.equals(font, _textFont)) {
                      _textFont = font;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.SCALE_FONT, font);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 106..111
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 163..168
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

          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

              public void setTickFont(Font font) {
                  if (!Objects.equals(font, _tickFont)) {
                      _tickFont = font;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.TICK_FONT, font);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 106..111
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 125..130
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 163..168
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 429..434

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

          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

              public void setNeedleType(String type) {
                  if (!Objects.equals(_needleType, type)) {
                      _needleType = type;
                      fireEvent(ChartDataEvent.CHANGED, DialChartDataEvent.NEEDLE_TYPE, type);
                  }
          Severity: Major
          Found in zul/src/main/java/org/zkoss/zul/DialModelScale.java and 4 other locations - About 30 mins to fix
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 106..111
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 125..130
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 163..168
          zul/src/main/java/org/zkoss/zul/DialModelScale.java on lines 295..300

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

          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

          There are no issues that match your filters.

          Category
          Status