workcraft/workcraft

View on GitHub
workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java

Summary

Maintainability
C
1 day
Test Coverage

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

    private static Set<Double> getIntersectionAdjustedToFrame(double p0, double p1, double p2, double p3, double s) {
Severity: Minor
Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java - About 35 mins to fix

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

            if (x2 != x1) {
                double dydx = (y2 - y1) / (x2 - x1);
                if ((xMin >= x1) == (xMin <= x2)) {
                    double yxMin = y1 + dydx * (xMin - x1);
                    if ((yxMin >= yMin) && (yxMin <= yMax)) {
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 263..277

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

    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

            if (y2 != y1) {
                double dxdy = (x2 - x1) / (y2 - y1);
                if ((yMin >= y1) == (yMin <= y2)) {
                    double xyMin = x1 + dxdy * (yMin - y1);
                    if ((xyMin >= xMin) && (xyMin <= xMax)) {
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 248..262

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

    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

            for (Double t : xs) {
                if ((t >= 0.0) && (t <= 1.0)) {
                    Point2D p = getPointOnCubicCurve(curve, t);
                    result.addAll(getIntersectionAdjustedToFrame(p, frame));
                }
    Severity: Minor
    Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 45 mins to fix
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 306..311

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

    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

            for (Double t : ys) {
                if ((t >= 0.0) && (t <= 1.0)) {
                    Point2D p = getPointOnCubicCurve(curve, t);
                    result.addAll(getIntersectionAdjustedToFrame(p, frame));
                }
    Severity: Minor
    Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 45 mins to fix
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 292..297

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

    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

        public static Point2D add(Point2D p1, Point2D p2) {
            Point2D result = (Point2D) p1.clone();
            result.setLocation(result.getX() + p2.getX(), result.getY() + p2.getY());
            return result;
        }
    Severity: Minor
    Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 35 mins to fix
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 30..34

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

    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

        public static Point2D subtract(Point2D p1, Point2D p2) {
            Point2D result = (Point2D) p1.clone();
            result.setLocation(result.getX() - p2.getX(), result.getY() - p2.getY());
            return result;
        }
    Severity: Minor
    Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 35 mins to fix
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 24..28

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

    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

            double aY = 3.0 * p3.getY() - 9.0 * p2.getY() + 9.0 * p1.getY() - 3.0 * p0.getY();
    Severity: Minor
    Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 35 mins to fix
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 226..226

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

    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

            double aX = 3.0 * p3.getX() - 9.0 * p2.getX() + 9.0 * p1.getX() - 3.0 * p0.getX();
    Severity: Minor
    Found in workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java and 1 other location - About 35 mins to fix
    workcraft/WorkcraftCore/src/org/workcraft/utils/Geometry.java on lines 231..231

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

    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