uccser/cs-field-guide

View on GitHub

Showing 873 of 873 total issues

File Treant.js has 1396 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Treant-js
 *
 * Modified by UCCSER:
 * Adds fix for showing arrows on connectors after a pseudo connector.
Severity: Major
Found in csfieldguide/static/interactives/tree-diagram/js/third-party/Treant.js - About 3 days to fix

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

class Migration(migrations.Migration):

    dependencies = [
        ('chapters', '0032_auto_20191008_2342'),
    ]
Severity: Major
Found in csfieldguide/chapters/migrations/0033_auto_20210805_0142.py and 1 other location - About 3 days to fix
csfieldguide/chapters/migrations/0022_auto_20180321_0115.py on lines 8..73

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

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

class Migration(migrations.Migration):

    dependencies = [
        ('chapters', '0021_auto_20180319_0245'),
    ]
Severity: Major
Found in csfieldguide/chapters/migrations/0022_auto_20180321_0115.py and 1 other location - About 3 days to fix
csfieldguide/chapters/migrations/0033_auto_20210805_0142.py on lines 6..71

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

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

$("input[name='interactive-rgb-mixer-colourCode']").click(function() {
  var temp = $("input[name='interactive-rgb-mixer-colourCode']:checked").val() == 'hex';
  if (temp != useHex) {
    useHex = temp;
    var r_val = $('#interactive-rgb-mixer-red-value').val() || 0;
Severity: Major
Found in csfieldguide/static/interactives/rgb-mixer/js/rgb-mixer.js and 1 other location - About 3 days to fix
csfieldguide/static/interactives/cmy-mixer/js/cmy-mixer.js on lines 71..120

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

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

$("input[name='interactive-cmy-mixer-colourCode']").click(function() {
  var temp = $("input[name='interactive-cmy-mixer-colourCode']:checked").val() == 'hex';
  if (temp != useHex) {
    useHex = temp;
    var c_val = $('#interactive-cmy-mixer-cyan-value').val() || 0;
Severity: Major
Found in csfieldguide/static/interactives/cmy-mixer/js/cmy-mixer.js and 1 other location - About 3 days to fix
csfieldguide/static/interactives/rgb-mixer/js/rgb-mixer.js on lines 84..133

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

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

  if (isPkcs) {
    try {
      Key = new nodeRSA($('#rsa-encryption-key').val().trim());
    } catch (error) {
      $('#rsa-encryption-status-text').html('<span class="text-danger">' + TXT_KEY_ERROR + '</span>');
csfieldguide/static/interactives/rsa-decryption/js/rsa-decryption.js on lines 334..379

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

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

  if (isPkcs) {
    try {
      Key = new nodeRSA($('#rsa-decryption-key').val().trim());
    } catch (error) {
      $('#rsa-decryption-status-text').html('<span class="text-danger">' + TXT_KEY_ERROR + '</span>');
csfieldguide/static/interactives/rsa-encryption/js/rsa-encryption.js on lines 334..379

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

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

function execute_bne (args, addr) {
    // bne $op1, $op2, [num instructions to skip]
        
    var op1 = args[1];
    var op2 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 758..784

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

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

function execute_beq (args, addr) {
    // beq $op1, $op2, [num instructions to skip]
    
    var op1 = args[1];
    var op2 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 790..816

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

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

function getPrivateComponents() {
  // Data gets a lot of changes: Buffer(?) as string -> bigInt -> calculations -> string -> hex -> Buffer
  // There is no perceivable delay but the efficiency could be investigated further in future
  
  var defaultE = 65537; // TODO: calculate e also (we can't assume this is true for people who don't use the key generator)
csfieldguide/static/interactives/rsa-encryption/js/rsa-encryption.js on lines 406..453

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

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

function getPrivateComponents() {
  // Data has had a lot of changes: Buffer(?) as string -> bigInt -> calculations -> string -> hex -> Buffer
  // There is no perceivable delay but the efficiency could be investigated further in future

  var defaultE = 65537; // TODO: calculate e also (we can't assume this is true for people who don't use the key generator)
csfieldguide/static/interactives/rsa-decryption/js/rsa-decryption.js on lines 402..449

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

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

File pixel-viewer.js has 1036 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Settings and intialize layout
this.MAX_HEIGHT = 133;
this.CELL_SIZE = 50;
this.MAX_NOISE = 15;

Severity: Major
Found in csfieldguide/static/interactives/pixel-viewer/js/pixel-viewer.js - About 2 days to fix

Function exports has a Cognitive Complexity of 125 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function( THREE ) {
    /**
    * @author Eric Haines / http://erichaines.com/
    *
    * Tessellates the famous Utah teapot database by Martin Newell into triangles.
Severity: Minor
Found in csfieldguide/static/js/third-party/threejs/TeapotGeometry.js - About 2 days to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

function interpretKeyComponents() {
  var pastedContent = $('#rsa-decryption-components-box').val().trim();
  $('#rsa-decryption-components-box').val("");
  if (pastedContent.startsWith('--')) {
    if (pastedContent.includes('PUBLIC')) {
csfieldguide/static/interactives/rsa-encryption/js/rsa-encryption.js on lines 203..248

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

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

function interpretKeyComponents() {
  var pastedContent = $('#rsa-encryption-components-box').val().trim();
  $('#rsa-encryption-components-box').val("");
  if (pastedContent.startsWith('--')) {
    if (pastedContent.includes('PUBLIC')) {
csfieldguide/static/interactives/rsa-decryption/js/rsa-decryption.js on lines 203..248

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

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

function execute_xor (args, addr) {
    // xor $dest, $op1, $op2
        
    var dest = args[1];
    var op1 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 550..570
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 576..596
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 602..622
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 628..648
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 654..674
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 680..700

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

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

function execute_sub (args, addr) {
    // sub $dest, $op1, $op2
    
    var dest = args[1];
    var op1 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 550..570
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 576..596
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 628..648
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 654..674
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 680..700
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 706..726

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

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

function execute_subu (args, addr) {
    // subu $dest, $op1, $op2
    
    var dest = args[1];
    var op1 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 550..570
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 576..596
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 602..622
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 654..674
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 680..700
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 706..726

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

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

function execute_add (args, addr) {
    // add $dest, $op1, $op2
    
    var dest = args[1];
    var op1 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 576..596
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 602..622
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 628..648
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 654..674
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 680..700
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 706..726

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

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

function execute_or (args, addr) {
    // or $dest, $op1, $op2
        
    var dest = args[1];
    var op1 = args[2];
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 550..570
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 576..596
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 602..622
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 628..648
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 654..674
csfieldguide/static/interactives/mips-simulator/js/mips-simulator.js on lines 706..726

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

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language