TestRoots/watchdog

View on GitHub

Showing 130 of 130 total issues

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

package nl.tudelft.watchdog.eclipse.ui;

import java.awt.Color;
import java.awt.Paint;
import java.util.List;
Severity: Minor
Found in eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java - About 6 hrs to fix

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

    public class WatchDogView extends ViewPart {
        private static final float FOREGROUND_TRANSPARENCY = 0.8f;
    
        /** The Id of the view. */
        public static final String ID = "WatchDog.view";
    Severity: Minor
    Found in eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java - About 4 hrs to fix

      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

        UIUtils has 31 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class UIUtils {
        
            /** The command to show the WatchDog info. */
            public static final String COMMAND_SHOW_INFO = "nl.tudelft.watchdog.commands.showWatchDogInfo";
            public static final Font HEADER_FONT = generateHeaderFont();
        Severity: Minor
        Found in eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/util/UIUtils.java - About 3 hrs to fix

          PreferencesBase has 29 methods (exceeds 20 allowed). Consider refactoring.
          Open

          public abstract class PreferencesBase {
          
              /** The map of registered projects. */
              protected List<ProjectPreferenceSetting> projectSettings = new ArrayList<ProjectPreferenceSetting>();
          
          
          Severity: Minor
          Found in core/src/nl/tudelft/watchdog/core/ui/preferences/PreferencesBase.java - About 3 hrs to fix

            Preferences has 28 methods (exceeds 20 allowed). Consider refactoring.
            Open

            public class Preferences extends PreferencesBase {
            
                /** The user's id on the WatchDog server. */
                public final static String USERID_KEY = "WATCHDOG.USERID";
            
            

              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

                Preferences has 26 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public class Preferences extends PreferencesBase {
                
                    /** The user's id on the WatchDog server. */
                    public final static String USERID_KEY = "USERID";
                
                

                  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

                  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);
                  intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java on lines 408..432

                  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

                  Method equals has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      @Override
                      public boolean equals(Object obj) {
                          if (this == obj) {
                              return true;
                          }

                  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

                  File watchdog_server.rb has 266 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  require 'digest/sha1'
                  
                  require 'sinatra'
                  require 'mongo'
                  require 'sinatra/contrib'
                  Severity: Minor
                  Found in server/lib/watchdog_server.rb - About 2 hrs to fix

                    File InfoDialog.java has 262 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    package nl.tudelft.watchdog.eclipse.ui;
                    
                    import org.eclipse.jface.dialogs.Dialog;
                    import org.eclipse.jface.dialogs.IDialogConstants;
                    import org.eclipse.swt.SWT;
                    Severity: Minor
                    Found in eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/InfoDialog.java - About 2 hrs to fix

                      Method createSlider has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private void createSlider(JPanel parent) {
                              JPanel questionPanel = UIUtils.createFlowJPanelLeft(parent);
                      
                              UIUtils.createLabel(questionPanel,
                                  SLIDER_QUESTION);

                        Method equals has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            @Override
                            public boolean equals(Object obj) {
                                if (this == obj) {
                                    return true;
                                }

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

                            public int compareTo(WatchDogItem comparedItem) {
                                if (comparedItem instanceof IntervalBase) {
                                    IntervalBase comparedInterval = (IntervalBase) comparedItem;
                                    int res = getEnd().compareTo(comparedInterval.getEnd());
                                    if (res == 0 && !this.equals(comparedInterval)) {

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

                                @Override
                                public void run() {
                                    super.run();
                                    isClosed = false;
                        
                        

                        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

                        package nl.tudelft.watchdog.intellij.logic.interval;
                        
                        import nl.tudelft.watchdog.core.logic.interval.IDEIntervalManagerBase;
                        import nl.tudelft.watchdog.core.logic.interval.IntervalStatisticsBase;
                        import nl.tudelft.watchdog.intellij.logic.interval.intervaltypes.JUnitInterval;
                        eclipse/plugin/src/nl/tudelft/watchdog/eclipse/logic/interval/IntervalStatistics.java on lines 1..42

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

                        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

                        package nl.tudelft.watchdog.eclipse.logic.interval;
                        
                        import java.util.List;
                        
                        import nl.tudelft.watchdog.core.logic.interval.IDEIntervalManagerBase;
                        intellij/src/nl/tudelft/watchdog/intellij/logic/interval/IntervalStatistics.java on lines 1..35

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

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

                            @Nullable
                            @Override
                            public JComponent createComponent() {
                                main = new JPanel();
                                main.setLayout(new BoxLayout(main, BoxLayout.Y_AXIS));
                          Severity
                          Category
                          Status
                          Source
                          Language