TestRoots/watchdog

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

Summary

Maintainability
D
3 days
Test Coverage

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

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

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

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

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

          Method createPartControl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @Override
              public void createPartControl(Composite parent) {
                  partService = getSite().getService(IPartService.class);
                  watchDogViewListener = new WatchDogViewListener(this);
                  partService.addPartListener(watchDogViewListener);
          Severity: Minor
          Found in eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java - About 1 hr to fix

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

                @Override
                public void createPartControl(Composite parent) {
                    partService = getSite().getService(IPartService.class);
                    watchDogViewListener = new WatchDogViewListener(this);
                    partService.addPartListener(watchDogViewListener);
            Severity: Minor
            Found in eclipse/plugin/src/nl/tudelft/watchdog/eclipse/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);
            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

            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 487..497
            intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java on lines 334..345

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

                private PieDataset createPerspectiveViewPieDataset() {
                    double divisor = perspectiveDebug + perspectiveJava + perspectiveOther;
                    DefaultPieDataset result = new DefaultPieDataset();
                    result.setValue("Java" + printPercent(perspectiveJava, divisor),
                            perspectiveJava);
            eclipse/plugin/src/nl/tudelft/watchdog/eclipse/ui/WatchDogView.java on lines 405..416
            intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java on lines 334..345

            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

            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),
            intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java on lines 354..362

            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

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

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

            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) + "%)";
            intellij/src/nl/tudelft/watchdog/intellij/ui/WatchDogView.java on lines 434..439

            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