acutesoftware/virtual-AI-simulator

View on GitHub
vais/z_prototypes/test_calc_building_design.py

Summary

Maintainability
D
2 days
Test Coverage

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

    def test_30_calc_basics_1_by_1(self):
        ans = mod_des.calc_basics(width=1, length=1, height=2.4, prevailing_wind=2.8)
        #print(ans)
        self.assertEqual(ans['area'] , 1) 
        self.assertEqual(ans['perim'] , 4) 
Severity: Major
Found in vais/z_prototypes/test_calc_building_design.py and 1 other location - About 5 hrs to fix
vais/z_prototypes/test_calc_building_design.py on lines 37..43

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

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

    def test_31_calc_basics_2_by_20(self):
        ans = mod_des.calc_basics(width=2, length=20, height=2.4, prevailing_wind=2.8)
        #print(ans)
        self.assertEqual(ans['area'] , 40) 
        self.assertEqual(ans['perim'] , 44) 
Severity: Major
Found in vais/z_prototypes/test_calc_building_design.py and 1 other location - About 5 hrs to fix
vais/z_prototypes/test_calc_building_design.py on lines 29..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 92.

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

    def test_10_rafter_410UB53_7(self):
        ans = mod_des.bld_rafter_deflection(length=16000, force=6.72, E_mod_elasticity=2.1, I_moment_of_intertia=188)
        self.assertEqual(ans['max deflection - distrib load'] , 145.24822695035462) 
        self.assertEqual(ans['max deflection - centre load'] ,  0.014524822695035461) 
Severity: Major
Found in vais/z_prototypes/test_calc_building_design.py and 1 other location - About 2 hrs to fix
vais/z_prototypes/test_calc_building_design.py on lines 24..27

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

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

    def test_11_rafter_530UB82(self):
        ans = mod_des.bld_rafter_deflection(length=16000, force=6.72, E_mod_elasticity=2.1, I_moment_of_intertia=477)
        self.assertEqual(ans['max deflection - distrib load'] , 57.24668064290706) 
        self.assertEqual(ans['max deflection - centre load'] ,  0.005724668064290706) 
Severity: Major
Found in vais/z_prototypes/test_calc_building_design.py and 1 other location - About 2 hrs to fix
vais/z_prototypes/test_calc_building_design.py on lines 19..22

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

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