cea-sec/miasm

View on GitHub

Showing 1,647 of 3,020 total issues

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

    b21 = (reversed_rm & i32(2**21)) >> i32(21) if b22 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b20 = (reversed_rm & i32(2**20)) >> i32(20) if b21 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b26 = (reversed_rm & i32(2**26)) >> i32(26) if b27 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b29 = (reversed_rm & i32(2**29)) >> i32(29) if b30 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b22 = (reversed_rm & i32(2**22)) >> i32(22) if b23 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b25 = (reversed_rm & i32(2**25)) >> i32(25) if b26 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b18 = (reversed_rm & i32(2**18)) >> i32(18) if b19 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b10 = (reversed_rm & i32(2**10)) >> i32(10) if b11 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b00 = (reversed_rm & i32(2 ** 0)) >> i32(0) if b01 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096

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

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

    b17 = (reversed_rm & i32(2**17)) >> i32(17) if b18 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b07 = (reversed_rm & i32(2 ** 7)) >> i32(7) if b08 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    _fields = [("expdesc", (lambda c, raw, off:c.gete(raw, off),
                            lambda c, value:c.sete(value)))]
Severity: Major
Found in miasm/loader/pe.py and 6 other locations - About 1 hr to fix
miasm/loader/pe.py on lines 261..262
miasm/loader/pe.py on lines 336..337
miasm/loader/pe.py on lines 852..853
miasm/loader/pe.py on lines 1129..1130
miasm/loader/pe.py on lines 1144..1145
miasm/loader/pe.py on lines 1297..1298

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

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

    _fields = [("resdesc", (lambda c, raw, off:c.gete(raw, off),
                            lambda c, value:c.sete(value)))]
Severity: Major
Found in miasm/loader/pe.py and 6 other locations - About 1 hr to fix
miasm/loader/pe.py on lines 261..262
miasm/loader/pe.py on lines 336..337
miasm/loader/pe.py on lines 641..642
miasm/loader/pe.py on lines 852..853
miasm/loader/pe.py on lines 1129..1130
miasm/loader/pe.py on lines 1144..1145

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

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

    elif (expr.is_op("CC_S>") and
          test_cc_eq_args(
              expr,
              "FLAG_SIGN_SUB",
              "FLAG_SUB_OF",
Severity: Major
Found in miasm/expression/simplifications_common.py and 6 other locations - About 1 hr to fix
miasm/expression/simplifications_common.py on lines 733..741
miasm/expression/simplifications_common.py on lines 757..765
miasm/expression/simplifications_common.py on lines 787..795
miasm/expression/simplifications_common.py on lines 836..845
miasm/expression/simplifications_common.py on lines 850..859
miasm/expression/simplifications_common.py on lines 906..915

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

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

    b16 = (reversed_rm & i32(2**16)) >> i32(16) if b17 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b08 = (reversed_rm & i32(2 ** 8)) >> i32(8) if b09 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    elif (expr.is_op("CC_S>=") and
          test_cc_eq_args(
              expr,
              "FLAG_SIGN_SUB",
              "FLAG_SUB_OF"
Severity: Major
Found in miasm/expression/simplifications_common.py and 6 other locations - About 1 hr to fix
miasm/expression/simplifications_common.py on lines 733..741
miasm/expression/simplifications_common.py on lines 757..765
miasm/expression/simplifications_common.py on lines 787..795
miasm/expression/simplifications_common.py on lines 823..833
miasm/expression/simplifications_common.py on lines 836..845
miasm/expression/simplifications_common.py on lines 906..915

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

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

def fdiv(ir, instr, arg1, arg2, arg3):
    e = []
    e.append(ExprAssign(arg1, ExprOp('fdiv', arg2, arg3)))
    return e, []
Severity: Major
Found in miasm/arch/aarch64/sem.py and 3 other locations - About 1 hr to fix
miasm/arch/aarch64/sem.py on lines 1948..1951
miasm/arch/aarch64/sem.py on lines 1954..1957
miasm/arch/aarch64/sem.py on lines 1960..1963

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

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

    b15 = (reversed_rm & i32(2**15)) >> i32(15) if b16 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1085..1085
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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

    b12 = (reversed_rm & i32(2**12)) >> i32(12) if b13 else i32(0)
Severity: Major
Found in miasm/arch/mep/sem.py and 31 other locations - About 1 hr to fix
miasm/arch/mep/sem.py on lines 1066..1066
miasm/arch/mep/sem.py on lines 1067..1067
miasm/arch/mep/sem.py on lines 1068..1068
miasm/arch/mep/sem.py on lines 1069..1069
miasm/arch/mep/sem.py on lines 1070..1070
miasm/arch/mep/sem.py on lines 1071..1071
miasm/arch/mep/sem.py on lines 1072..1072
miasm/arch/mep/sem.py on lines 1073..1073
miasm/arch/mep/sem.py on lines 1074..1074
miasm/arch/mep/sem.py on lines 1075..1075
miasm/arch/mep/sem.py on lines 1076..1076
miasm/arch/mep/sem.py on lines 1077..1077
miasm/arch/mep/sem.py on lines 1078..1078
miasm/arch/mep/sem.py on lines 1079..1079
miasm/arch/mep/sem.py on lines 1080..1080
miasm/arch/mep/sem.py on lines 1081..1081
miasm/arch/mep/sem.py on lines 1082..1082
miasm/arch/mep/sem.py on lines 1083..1083
miasm/arch/mep/sem.py on lines 1084..1084
miasm/arch/mep/sem.py on lines 1086..1086
miasm/arch/mep/sem.py on lines 1087..1087
miasm/arch/mep/sem.py on lines 1088..1088
miasm/arch/mep/sem.py on lines 1089..1089
miasm/arch/mep/sem.py on lines 1090..1090
miasm/arch/mep/sem.py on lines 1091..1091
miasm/arch/mep/sem.py on lines 1092..1092
miasm/arch/mep/sem.py on lines 1093..1093
miasm/arch/mep/sem.py on lines 1094..1094
miasm/arch/mep/sem.py on lines 1095..1095
miasm/arch/mep/sem.py on lines 1096..1096
miasm/arch/mep/sem.py on lines 1097..1097

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

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