cea-sec/miasm

View on GitHub

Showing 1,647 of 3,020 total issues

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

    if arg2.is_int(3) and arg3.is_int(3) and arg4.is_id("c4") and arg5.is_id("c2") and arg6.is_int(0):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(3) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(1):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

        if self.parent_head._wsize == 32:
            mask_ptr = 0x80000000
        elif self.parent_head._wsize == 64:
            mask_ptr = 0x8000000000000000
Severity: Major
Found in miasm/loader/pe.py and 4 other locations - About 1 hr to fix
miasm/loader/pe.py on lines 342..345
miasm/loader/pe.py on lines 460..463
miasm/loader/pe.py on lines 876..879
miasm/loader/pe.py on lines 1018..1021

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

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

        if self.parent_head._wsize == 32:
            mask_ptr = 0x80000000
        elif self.parent_head._wsize == 64:
            mask_ptr = 0x8000000000000000
Severity: Major
Found in miasm/loader/pe.py and 4 other locations - About 1 hr to fix
miasm/loader/pe.py on lines 342..345
miasm/loader/pe.py on lines 460..463
miasm/loader/pe.py on lines 518..521
miasm/loader/pe.py on lines 876..879

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(4):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(2):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(0):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603

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

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

    if args.hwnd == winobjs.module_cur_hwnd:
        pass
    elif args.hwnd in winobjs.handle_pool:
        pass
    else:
Severity: Major
Found in miasm/os_dep/win_api_x86_32.py and 3 other locations - About 1 hr to fix
miasm/os_dep/win_api_x86_32.py on lines 726..731
miasm/os_dep/win_api_x86_32.py on lines 2820..2825
miasm/os_dep/win_api_x86_32.py on lines 2848..2853

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

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

    elif arg1.is_int(3) and arg2.is_int(3) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(0):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(3):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(0):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(4):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(3) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(1):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    if args.hwnd == winobjs.module_cur_hwnd:
        pass
    elif args.hwnd in winobjs.handle_pool:
        pass
    else:
Severity: Major
Found in miasm/os_dep/win_api_x86_32.py and 3 other locations - About 1 hr to fix
miasm/os_dep/win_api_x86_32.py on lines 2820..2825
miasm/os_dep/win_api_x86_32.py on lines 2848..2853
miasm/os_dep/win_api_x86_32.py on lines 2892..2897

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

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

        if not (isinstance(e, ExprOp) and e.op == "preinc"):
            log.debug('cannot encode %r', e)
            return False
Severity: Major
Found in miasm/arch/arm/arch.py and 2 other locations - About 1 hr to fix
miasm/arch/arm/arch.py on lines 2083..2085
miasm/arch/arm/arch.py on lines 2155..2157

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

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

        if not (isinstance(e, ExprOp) and e.op == "preinc"):
            log.debug('cannot encode %r', e)
            return False
Severity: Major
Found in miasm/arch/arm/arch.py and 2 other locations - About 1 hr to fix
miasm/arch/arm/arch.py on lines 2049..2051
miasm/arch/arm/arch.py on lines 2155..2157

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

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

    elif arg1.is_int(3) and arg2.is_int(3) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(7):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(0) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(2):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1582..1582
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

    elif arg1.is_int(3) and arg2.is_int(3) and arg3.is_id("c4") and arg4.is_id("c2") and arg5.is_int(7):
Severity: Major
Found in miasm/arch/aarch64/sem.py and 17 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1504..1504
miasm/arch/aarch64/sem.py on lines 1513..1513
miasm/arch/aarch64/sem.py on lines 1519..1519
miasm/arch/aarch64/sem.py on lines 1525..1525
miasm/arch/aarch64/sem.py on lines 1531..1531
miasm/arch/aarch64/sem.py on lines 1537..1537
miasm/arch/aarch64/sem.py on lines 1543..1543
miasm/arch/aarch64/sem.py on lines 1552..1552
miasm/arch/aarch64/sem.py on lines 1558..1558
miasm/arch/aarch64/sem.py on lines 1576..1576
miasm/arch/aarch64/sem.py on lines 1585..1585
miasm/arch/aarch64/sem.py on lines 1588..1588
miasm/arch/aarch64/sem.py on lines 1591..1591
miasm/arch/aarch64/sem.py on lines 1594..1594
miasm/arch/aarch64/sem.py on lines 1597..1597
miasm/arch/aarch64/sem.py on lines 1603..1603
miasm/arch/aarch64/sem.py on lines 1606..1606

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

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

        if self.parent_head._wsize == 32:
            mask_ptr = 0x80000000
        elif self.parent_head._wsize == 64:
            mask_ptr = 0x8000000000000000
Severity: Major
Found in miasm/loader/pe.py and 4 other locations - About 1 hr to fix
miasm/loader/pe.py on lines 342..345
miasm/loader/pe.py on lines 460..463
miasm/loader/pe.py on lines 518..521
miasm/loader/pe.py on lines 1018..1021

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

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