alexbrjo/MolassOS

View on GitHub

Showing 185 of 185 total issues

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

operation[operation.RNZ] = function (reg) {
    if (reg.ZERO === 0) {
        reg.POP();
    } else {
        reg.PC += 3; 
Severity: Major
Found in src/hardware/instructions/Return.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Return.js on lines 13..19
src/hardware/instructions/Return.js on lines 21..27
src/hardware/instructions/Return.js on lines 29..35

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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.RPO] = function (reg) {
    if (reg.PARITY === 0) {
        reg.POP();
    } else {
        reg.PC += 3; 
Severity: Major
Found in src/hardware/instructions/Return.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Return.js on lines 5..11
src/hardware/instructions/Return.js on lines 13..19
src/hardware/instructions/Return.js on lines 21..27

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 4 locations. Consider refactoring.
Open

operation[operation.RP] = function (reg) {
    if (reg.SIGN === 0) {
        reg.POP();
    } else {
        reg.PC += 3; 
Severity: Major
Found in src/hardware/instructions/Return.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Return.js on lines 5..11
src/hardware/instructions/Return.js on lines 13..19
src/hardware/instructions/Return.js on lines 29..35

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 4 locations. Consider refactoring.
Open

operation[operation.RNC] = function (reg) {
    if (reg.CARRY === 0) {
        reg.POP(); 
    } else {
        reg.PC += 3; 
Severity: Major
Found in src/hardware/instructions/Return.js and 3 other locations - About 1 hr to fix
src/hardware/instructions/Return.js on lines 5..11
src/hardware/instructions/Return.js on lines 21..27
src/hardware/instructions/Return.js on lines 29..35

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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

Function preprocess has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

var preprocess = function (src) {

    /** Preprocessor FSM states */
    var state = new WaitState('');

Severity: Minor
Found in src/asm/Preprocess.js - About 1 hr to fix

    Function NumberState has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    var NumberState = function (char) {
        this.name = "NUMBER";
        var content = char;
        this.nextNumber = function (char) {
            // add number to number
    Severity: Minor
    Found in src/asm/PreprocessStates.js - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language