CellProfiler/centrosome

View on GitHub

Showing 257 of 380 total issues

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

            for k in range(class_count):
                norm = scipy.stats.norm(class_mean[k], class_std[k])
                pixel_class_prob[:, k] = class_prob[k] * norm.pdf(data)
Severity: Major
Found in centrosome/threshold.py and 1 other location - About 3 hrs to fix
centrosome/threshold.py on lines 475..477

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

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

    for k in range(class_count):
        norm = scipy.stats.norm(class_mean[k], class_std[k])
        class_gaussian[:, k] = class_prob[k] * norm.pdf(level)
Severity: Major
Found in centrosome/threshold.py and 1 other location - About 3 hrs to fix
centrosome/threshold.py on lines 441..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 68.

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

            thin_table[1, i] = (pat[2, 1] or pat[2, 0] or not pat[0, 0]) and pat[1, 0]
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 3 hrs to fix
centrosome/cpmorphology.py on lines 3928..3928

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

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

            thin_table[0, i] = (pat[0, 1] or pat[0, 2] or not pat[2, 2]) and pat[1, 2]
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 3 hrs to fix
centrosome/cpmorphology.py on lines 3929..3929

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

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

    @property
    def predicted_state_vec(self):
        """The predicted state vector for the next time point

        From Welch eqn 1.9
Severity: Major
Found in centrosome/filter.py and 1 other location - About 3 hrs to fix
centrosome/filter.py on lines 967..977

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

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

    @property
    def predicted_obs_vec(self):
        """The predicted observation vector

        The observation vector for the next step in the filter.
Severity: Major
Found in centrosome/filter.py and 1 other location - About 3 hrs to fix
centrosome/filter.py on lines 950..960

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

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

        for col in [
            i
            for i in range(0, len(detections_2))
            if detections_2[i].is_reliable()
            and (not params["check_if_big"] or self.is_cell_big(detections_2[i]))
Severity: Major
Found in centrosome/neighmovetrack.py and 1 other location - About 3 hrs to fix
centrosome/neighmovetrack.py on lines 381..385

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

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

        dot_vs1s0 = np.sum(s01 * vs1, 1) / np.sqrt(
            np.sum(s01 ** 2, 1) * np.sum(vs1 ** 2, 1)
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 3 hrs to fix
centrosome/cpmorphology.py on lines 1594..1595

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

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

        dot_vs0s1 = np.sum(s10 * vs0, 1) / np.sqrt(
            np.sum(s01 ** 2, 1) * np.sum(vs0 ** 2, 1)
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 3 hrs to fix
centrosome/cpmorphology.py on lines 1589..1590

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

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

        for row in [
            i
            for i in range(0, len(detections_1))
            if detections_1[i].is_reliable()
            and (not params["check_if_big"] or self.is_cell_big(detections_1[i]))
Severity: Major
Found in centrosome/neighmovetrack.py and 1 other location - About 3 hrs to fix
centrosome/neighmovetrack.py on lines 391..395

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

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

            dc = distance2_to_line(
                chull_pts[chull_idx + antipode_idx, :],
                chull_pts[chull_idx + vertex_idx, :],
                chull_pts[chull_idx + vertex_idx + 1, :],
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 3 hrs to fix
centrosome/cpmorphology.py on lines 4917..4920

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

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

            dn = distance2_to_line(
                chull_pts[chull_idx + next_antipode_idx, :],
                chull_pts[chull_idx + vertex_idx, :],
                chull_pts[chull_idx + vertex_idx + 1, :],
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 3 hrs to fix
centrosome/cpmorphology.py on lines 4907..4910

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

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

        binary_shrink_top_right &= make_table(
            False,
            np.array([[0, 0, 0], [0, 1, 0], [0, 0, 1]], bool),
            np.array([[1, 1, 1], [1, 1, 0], [1, 0, 1]], bool),
Severity: Major
Found in centrosome/cpmorphology.py and 9 other locations - About 2 hrs to fix
centrosome/cpmorphology.py on lines 236..239
centrosome/cpmorphology.py on lines 241..244
centrosome/cpmorphology.py on lines 246..249
centrosome/cpmorphology.py on lines 256..259
centrosome/cpmorphology.py on lines 272..275
centrosome/cpmorphology.py on lines 277..280
centrosome/cpmorphology.py on lines 282..285
centrosome/cpmorphology.py on lines 287..290
centrosome/cpmorphology.py on lines 292..295

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

Similar blocks of code found in 10 locations. Consider refactoring.
Open

        binary_shrink_top_right &= make_table(
            False,
            np.array([[0, 0, 0], [1, 1, 0], [0, 0, 0]], bool),
            np.array([[0, 0, 1], [1, 1, 1], [0, 0, 1]], bool),
Severity: Major
Found in centrosome/cpmorphology.py and 9 other locations - About 2 hrs to fix
centrosome/cpmorphology.py on lines 236..239
centrosome/cpmorphology.py on lines 246..249
centrosome/cpmorphology.py on lines 251..254
centrosome/cpmorphology.py on lines 256..259
centrosome/cpmorphology.py on lines 272..275
centrosome/cpmorphology.py on lines 277..280
centrosome/cpmorphology.py on lines 282..285
centrosome/cpmorphology.py on lines 287..290
centrosome/cpmorphology.py on lines 292..295

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

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

    if not mask is None:
        not_mask = np.logical_not(mask)
        big_image[iradius:-iradius, iradius:-iradius][not_mask] = 1
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 2 hrs to fix
centrosome/cpmorphology.py on lines 3037..3039

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

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

    if not mask is None:
        not_mask = np.logical_not(mask)
        big_image[iradius:-iradius, iradius:-iradius][not_mask] = 0
Severity: Major
Found in centrosome/cpmorphology.py and 1 other location - About 2 hrs to fix
centrosome/cpmorphology.py on lines 3008..3010

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

Similar blocks of code found in 10 locations. Consider refactoring.
Open

        binary_shrink_bottom_left &= make_table(
            False,
            np.array([[0, 0, 0], [0, 1, 1], [0, 0, 0]], bool),
            np.array([[1, 0, 0], [1, 1, 1], [1, 0, 0]], bool),
Severity: Major
Found in centrosome/cpmorphology.py and 9 other locations - About 2 hrs to fix
centrosome/cpmorphology.py on lines 236..239
centrosome/cpmorphology.py on lines 241..244
centrosome/cpmorphology.py on lines 246..249
centrosome/cpmorphology.py on lines 251..254
centrosome/cpmorphology.py on lines 256..259
centrosome/cpmorphology.py on lines 272..275
centrosome/cpmorphology.py on lines 282..285
centrosome/cpmorphology.py on lines 287..290
centrosome/cpmorphology.py on lines 292..295

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

Similar blocks of code found in 10 locations. Consider refactoring.
Open

        binary_shrink_top_right &= make_table(
            False,
            np.array([[0, 0, 0], [0, 1, 0], [1, 0, 0]], bool),
            np.array([[1, 1, 1], [0, 1, 1], [1, 0, 1]], bool),
Severity: Major
Found in centrosome/cpmorphology.py and 9 other locations - About 2 hrs to fix
centrosome/cpmorphology.py on lines 241..244
centrosome/cpmorphology.py on lines 246..249
centrosome/cpmorphology.py on lines 251..254
centrosome/cpmorphology.py on lines 256..259
centrosome/cpmorphology.py on lines 272..275
centrosome/cpmorphology.py on lines 277..280
centrosome/cpmorphology.py on lines 282..285
centrosome/cpmorphology.py on lines 287..290
centrosome/cpmorphology.py on lines 292..295

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

Similar blocks of code found in 10 locations. Consider refactoring.
Open

        binary_shrink_bottom_left &= make_table(
            False,
            np.array([[1, 1, 0], [0, 1, 1], [0, 0, 0]], bool),
            np.array([[0, 1, 0], [1, 1, 1], [1, 0, 0]], bool),
Severity: Major
Found in centrosome/cpmorphology.py and 9 other locations - About 2 hrs to fix
centrosome/cpmorphology.py on lines 236..239
centrosome/cpmorphology.py on lines 241..244
centrosome/cpmorphology.py on lines 246..249
centrosome/cpmorphology.py on lines 251..254
centrosome/cpmorphology.py on lines 256..259
centrosome/cpmorphology.py on lines 272..275
centrosome/cpmorphology.py on lines 277..280
centrosome/cpmorphology.py on lines 287..290
centrosome/cpmorphology.py on lines 292..295

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

Similar blocks of code found in 10 locations. Consider refactoring.
Open

        binary_shrink_bottom_left &= make_table(
            False,
            np.array([[0, 0, 1], [0, 1, 0], [0, 0, 0]], bool),
            np.array([[1, 0, 1], [1, 1, 0], [1, 1, 1]], bool),
Severity: Major
Found in centrosome/cpmorphology.py and 9 other locations - About 2 hrs to fix
centrosome/cpmorphology.py on lines 236..239
centrosome/cpmorphology.py on lines 241..244
centrosome/cpmorphology.py on lines 246..249
centrosome/cpmorphology.py on lines 251..254
centrosome/cpmorphology.py on lines 256..259
centrosome/cpmorphology.py on lines 277..280
centrosome/cpmorphology.py on lines 282..285
centrosome/cpmorphology.py on lines 287..290
centrosome/cpmorphology.py on lines 292..295

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

Severity
Category
Status
Source
Language