alexbrjo/MolassOS

View on GitHub
src/hardware/instructions/Math.js

Summary

Maintainability
F
1 wk
Test Coverage

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

operation[operation.ADC_B] = function (reg) { reg.A = reg.A + reg.B + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 1 other location - About 1 hr to fix
src/hardware/instructions/Math.js on lines 35..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 63.

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

operation[operation.SBB_B] = function (reg) { reg.A = reg.A - reg.B - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 1 other location - About 1 hr to fix
src/hardware/instructions/Math.js on lines 13..13

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

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

operation[operation.ADI]   = function (reg, a) { reg.A = reg.A + a + reg.CARRY; reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 1 other location - About 1 hr to fix
src/hardware/instructions/Math.js on lines 43..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 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

operation[operation.SBI] = function (reg, a){ reg.A = reg.A - a  - reg.CARRY; reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 1 other location - About 1 hr to fix
src/hardware/instructions/Math.js on lines 21..21

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 62.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

operation[operation.SBB_C] = function (reg) { reg.A = reg.A - reg.C - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_D] = function (reg) { reg.A = reg.A + reg.D + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_A] = function (reg) { reg.A = reg.A + reg.A + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_H] = function (reg) { reg.A = reg.A + reg.H + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_E] = function (reg) { reg.A = reg.A + reg.E + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_C] = function (reg) { reg.A = reg.A + reg.C + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.SBB_E] = function (reg) { reg.A = reg.A - reg.E - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.SBB_M] = function (reg) { reg.A = reg.A - reg.M - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.SBB_A] = function (reg) { reg.A = reg.A - reg.A - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41

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

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

operation[operation.SBB_H] = function (reg) { reg.A = reg.A - reg.H - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_L] = function (reg) { reg.A = reg.A + reg.L + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.ADC_M] = function (reg) { reg.A = reg.A + reg.M + reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.SBB_D] = function (reg) { reg.A = reg.A - reg.D - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 40..40
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.SBB_L] = function (reg) { reg.A = reg.A - reg.L - reg.CARRY; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 13 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 14..14
src/hardware/instructions/Math.js on lines 15..15
src/hardware/instructions/Math.js on lines 16..16
src/hardware/instructions/Math.js on lines 17..17
src/hardware/instructions/Math.js on lines 18..18
src/hardware/instructions/Math.js on lines 19..19
src/hardware/instructions/Math.js on lines 20..20
src/hardware/instructions/Math.js on lines 36..36
src/hardware/instructions/Math.js on lines 37..37
src/hardware/instructions/Math.js on lines 38..38
src/hardware/instructions/Math.js on lines 39..39
src/hardware/instructions/Math.js on lines 41..41
src/hardware/instructions/Math.js on lines 42..42

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

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

operation[operation.SUB_B] = function (reg) { reg.A = reg.A - reg.B; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 46..46
src/hardware/instructions/Math.js on lines 57..57
src/hardware/instructions/Math.js on lines 68..68

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

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

operation[operation.ORA_B] = function (reg) { reg.A = reg.A | reg.B; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 24..24
src/hardware/instructions/Math.js on lines 46..46
src/hardware/instructions/Math.js on lines 57..57

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

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

operation[operation.ANA_B] = function (reg) { reg.A = reg.A & reg.B; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 24..24
src/hardware/instructions/Math.js on lines 57..57
src/hardware/instructions/Math.js on lines 68..68

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

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

operation[operation.XRA_B] = function (reg) { reg.A = reg.A ^ reg.B; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Math.js on lines 24..24
src/hardware/instructions/Math.js on lines 46..46
src/hardware/instructions/Math.js on lines 68..68

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

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

operation[operation.ORI] = function (reg, a) { reg.A = reg.A | a; reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 4 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 32..32
src/hardware/instructions/Math.js on lines 54..54
src/hardware/instructions/Math.js on lines 65..65
src/hardware/instructions/Math.js on lines 87..87

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

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

operation[operation.CPI] = function (reg, a) { reg.A = reg.A - a; reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 4 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 32..32
src/hardware/instructions/Math.js on lines 54..54
src/hardware/instructions/Math.js on lines 65..65
src/hardware/instructions/Math.js on lines 76..76

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

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

operation[operation.SUI] = function (reg, a) { reg.A = reg.A - a; reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 4 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 54..54
src/hardware/instructions/Math.js on lines 65..65
src/hardware/instructions/Math.js on lines 76..76
src/hardware/instructions/Math.js on lines 87..87

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

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

operation[operation.ANI] = function (reg, a){ reg.A = reg.A & a;     reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 4 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 32..32
src/hardware/instructions/Math.js on lines 65..65
src/hardware/instructions/Math.js on lines 76..76
src/hardware/instructions/Math.js on lines 87..87

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

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

operation[operation.XRI] = function (reg, a) { reg.A = reg.A ^ a; reg.PC += 2; };
Severity: Major
Found in src/hardware/instructions/Math.js and 4 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 32..32
src/hardware/instructions/Math.js on lines 54..54
src/hardware/instructions/Math.js on lines 76..76
src/hardware/instructions/Math.js on lines 87..87

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

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

operation[operation.SUB_D] = function (reg) { reg.A = reg.A - reg.D; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_D] = function (reg) { reg.A = reg.A & reg.D; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.XRA_H] = function (reg) { reg.A = reg.A ^ reg.H; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ADD_D] = function (reg) { reg.A = reg.A + reg.D; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.CMP_H] = function (reg) { reg.byte(reg.A - reg.H); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 80..80
src/hardware/instructions/Math.js on lines 81..81
src/hardware/instructions/Math.js on lines 82..82
src/hardware/instructions/Math.js on lines 84..84
src/hardware/instructions/Math.js on lines 85..85
src/hardware/instructions/Math.js on lines 86..86

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

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

operation[operation.SUB_A] = function (reg) { reg.A = reg.A - reg.A; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_L] = function (reg) { reg.A = reg.A & reg.L; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.XRA_M] = function (reg) { reg.A = reg.A ^ reg.M; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.XRA_A] = function (reg) { reg.A = reg.A ^ reg.A; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_D] = function (reg) { reg.A = reg.A | reg.D; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.SUB_E] = function (reg) { reg.A = reg.A - reg.E; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_A] = function (reg) { reg.A = reg.A & reg.A; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.XRA_C] = function (reg) { reg.A = reg.A ^ reg.C; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_E] = function (reg) { reg.A = reg.A | reg.E; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_H] = function (reg) { reg.A = reg.A | reg.H; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_C] = function (reg) { reg.A = reg.A & reg.C; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_M] = function (reg) { reg.A = reg.A | reg.M; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_A] = function (reg) { reg.A = reg.A | reg.A; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74

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

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

operation[operation.ADD_B] = function (reg) { reg.A = reg.A + reg.B; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.SUB_L] = function (reg) { reg.A = reg.A - reg.L; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.CMP_C] = function (reg) { reg.byte(reg.A - reg.C); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 81..81
src/hardware/instructions/Math.js on lines 82..82
src/hardware/instructions/Math.js on lines 83..83
src/hardware/instructions/Math.js on lines 84..84
src/hardware/instructions/Math.js on lines 85..85
src/hardware/instructions/Math.js on lines 86..86

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

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

operation[operation.CMP_E] = function (reg) { reg.byte(reg.A - reg.E); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 80..80
src/hardware/instructions/Math.js on lines 81..81
src/hardware/instructions/Math.js on lines 83..83
src/hardware/instructions/Math.js on lines 84..84
src/hardware/instructions/Math.js on lines 85..85
src/hardware/instructions/Math.js on lines 86..86

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

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

operation[operation.XRA_E] = function (reg) { reg.A = reg.A ^ reg.E; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_E] = function (reg) { reg.A = reg.A & reg.E; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_M] = function (reg) { reg.A = reg.A & reg.M; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.XRA_D] = function (reg) { reg.A = reg.A ^ reg.D; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.XRA_L] = function (reg) { reg.A = reg.A ^ reg.L; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_L] = function (reg) { reg.A = reg.A | reg.L; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ADD_M] = function (reg) { reg.A = reg.A + reg.M; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ANA_H] = function (reg) { reg.A = reg.A & reg.H; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.CMP_L] = function (reg) { reg.byte(reg.A - reg.L); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 80..80
src/hardware/instructions/Math.js on lines 81..81
src/hardware/instructions/Math.js on lines 82..82
src/hardware/instructions/Math.js on lines 83..83
src/hardware/instructions/Math.js on lines 85..85
src/hardware/instructions/Math.js on lines 86..86

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

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

operation[operation.ADD_H] = function (reg) { reg.A = reg.A + reg.H; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.CMP_M] = function (reg) { reg.byte(reg.A - reg.M); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 80..80
src/hardware/instructions/Math.js on lines 81..81
src/hardware/instructions/Math.js on lines 82..82
src/hardware/instructions/Math.js on lines 83..83
src/hardware/instructions/Math.js on lines 84..84
src/hardware/instructions/Math.js on lines 86..86

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

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

operation[operation.CMP_D] = function (reg) { reg.byte(reg.A - reg.D); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 80..80
src/hardware/instructions/Math.js on lines 82..82
src/hardware/instructions/Math.js on lines 83..83
src/hardware/instructions/Math.js on lines 84..84
src/hardware/instructions/Math.js on lines 85..85
src/hardware/instructions/Math.js on lines 86..86

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

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

operation[operation.SUB_M] = function (reg) { reg.A = reg.A - reg.M; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ORA_C] = function (reg) { reg.A = reg.A | reg.C; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ADD_C] = function (reg) { reg.A = reg.A + reg.C; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ADD_L] = function (reg) { reg.A = reg.A + reg.L; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.SUB_C] = function (reg) { reg.A = reg.A - reg.C; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.SUB_H] = function (reg) { reg.A = reg.A - reg.H; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 6..6
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.ADD_E] = function (reg) { reg.A = reg.A + reg.E; reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 34 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 3..3
src/hardware/instructions/Math.js on lines 4..4
src/hardware/instructions/Math.js on lines 5..5
src/hardware/instructions/Math.js on lines 7..7
src/hardware/instructions/Math.js on lines 8..8
src/hardware/instructions/Math.js on lines 9..9
src/hardware/instructions/Math.js on lines 25..25
src/hardware/instructions/Math.js on lines 26..26
src/hardware/instructions/Math.js on lines 27..27
src/hardware/instructions/Math.js on lines 28..28
src/hardware/instructions/Math.js on lines 29..29
src/hardware/instructions/Math.js on lines 30..30
src/hardware/instructions/Math.js on lines 31..31
src/hardware/instructions/Math.js on lines 47..47
src/hardware/instructions/Math.js on lines 48..48
src/hardware/instructions/Math.js on lines 49..49
src/hardware/instructions/Math.js on lines 50..50
src/hardware/instructions/Math.js on lines 51..51
src/hardware/instructions/Math.js on lines 52..52
src/hardware/instructions/Math.js on lines 53..53
src/hardware/instructions/Math.js on lines 58..58
src/hardware/instructions/Math.js on lines 59..59
src/hardware/instructions/Math.js on lines 60..60
src/hardware/instructions/Math.js on lines 61..61
src/hardware/instructions/Math.js on lines 62..62
src/hardware/instructions/Math.js on lines 63..63
src/hardware/instructions/Math.js on lines 64..64
src/hardware/instructions/Math.js on lines 69..69
src/hardware/instructions/Math.js on lines 70..70
src/hardware/instructions/Math.js on lines 71..71
src/hardware/instructions/Math.js on lines 72..72
src/hardware/instructions/Math.js on lines 73..73
src/hardware/instructions/Math.js on lines 74..74
src/hardware/instructions/Math.js on lines 75..75

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

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

operation[operation.CMP_A] = function (reg) { reg.byte(reg.A - reg.A); reg.PC++; };
Severity: Major
Found in src/hardware/instructions/Math.js and 6 other locations - About 55 mins to fix
src/hardware/instructions/Math.js on lines 80..80
src/hardware/instructions/Math.js on lines 81..81
src/hardware/instructions/Math.js on lines 82..82
src/hardware/instructions/Math.js on lines 83..83
src/hardware/instructions/Math.js on lines 84..84
src/hardware/instructions/Math.js on lines 85..85

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

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

operation[operation.RAR] = function (reg) { reg.A = reg.A >>> 1; reg.PC++; };
Severity: Minor
Found in src/hardware/instructions/Math.js and 1 other location - About 40 mins to fix
src/hardware/instructions/Math.js on lines 112..112

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

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

operation[operation.RAL] = function (reg) { reg.A = reg.A << 1;  reg.PC++; };
Severity: Minor
Found in src/hardware/instructions/Math.js and 1 other location - About 40 mins to fix
src/hardware/instructions/Math.js on lines 113..113

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

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