TestRoots/watchdog

View on GitHub
intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java

Summary

Maintainability
D
2 days
Test Coverage

File WatchDogView.java has 345 lines of code (exceeds 250 allowed). Consider refactoring.
Open

package nl.tudelft.watchdog.intellij.ui;

import com.intellij.openapi.ui.ComboBox;
import com.intellij.openapi.ui.SimpleToolWindowPanel;
import com.intellij.ui.JBColor;
Severity: Minor
Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java - About 4 hrs to fix

    WatchDogView has 27 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class WatchDogView extends SimpleToolWindowPanel {
        private static final float FOREGROUND_TRANSPARENCY = 0.8f;
    
        /**
         * The Id of the view.
    Severity: Minor
    Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java - About 3 hrs to fix

      Method createActiveView has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private void createActiveView() {
              // General section.
              UIUtils.createTitleLabel(UIUtils.createGridedJPanel(oneColumn, 1), "General\n");
      
              JComponent generalSectionContainer = UIUtils.createGridedJPanel(oneColumn, 2);
      Severity: Minor
      Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java - About 1 hr to fix

        Method calculateTimes has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private void calculateTimes() {
                intervalStatistics = new IntervalStatistics(InitializationManager
                        .getInstance(WatchDogUtils.getProject()).getIntervalManager(), selectedTimePeriod);
        
                intelliJOpen = intervalStatistics
        Severity: Minor
        Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java - About 1 hr to fix

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

              public void createWatchDogView() {
                  oneColumn = UIUtils.createVerticalBoxJPanel(parent);
          
                  if (!WatchDogUtils.isWatchDogActive(WatchDogUtils.getProject())) {
                      createInactiveViewContent();
          Severity: Minor
          Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.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

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

              private CategoryDataset createJunitExecutionBarDataset() {
                  double differenceSeconds = Math.abs(averageTestDurationSeconds
                          - junitRunsCount);
                  double differenceMinutes = Math.abs(averageTestDurationMinutes
                          - junitRunsCount);
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 499..523

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

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

              private PieDataset createDevelopmentPieDataset() {
                  double divisor = userReading + userTyping + userActiveRest;
                  DefaultPieDataset result = new DefaultPieDataset();
                  result.setValue("Reading" + printPercent(userReading, divisor),
                          userReading);
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 405..416
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 487..497

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

          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

              private DefaultCategoryDataset createDevelopmentBarDataset() {
                  DefaultCategoryDataset result = new DefaultCategoryDataset();
                  result.setValue(userReading, "1", "Reading");
                  result.setValue(userTyping, "1", "Writing");
                  result.setValue(userActive, "1", "User Active");
          Severity: Minor
          Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java and 1 other location - About 55 mins to fix
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 396..403

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

          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

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

              private PieDataset createProductionVSTestPieDataset() {
                  double divisor = userProduction + userTest;
                  DefaultPieDataset result = new DefaultPieDataset();
                  result.setValue(
                          "Production Code" + printPercent(userProduction, divisor),
          Severity: Minor
          Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java and 1 other location - About 55 mins to fix
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 425..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 63.

          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

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

              private JFreeChart createPieChart(final PieDataset dataset, String title) {
                  JFreeChart chart = ChartFactory.createPieChart3D(title, dataset, true,
                          true, false);
                  PiePlot3D plot = (PiePlot3D) chart.getPlot();
                  plot.setDirection(Rotation.CLOCKWISE);
          Severity: Minor
          Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java and 1 other location - About 50 mins to fix
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 436..443

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

          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

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

              private String printPercent(double dividend, double divisor) {
                  if (divisor == 0) {
                      return " (--)";
                  }
                  return " (" + String.format("%.1f", dividend * 100 / divisor) + "%)";
          Severity: Minor
          Found in intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java and 1 other location - About 35 mins to fix
          eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 525..530

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

          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