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;
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";
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;
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();
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>();
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.
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
}
- Read upRead up
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'
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;
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;
}
- Read upRead up
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)) {
- Read upRead up
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;
- Read upRead up
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;
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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;
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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));