uccser/cs-field-guide

View on GitHub
csfieldguide/static/interactives/scene-editor/js/scene-editor.js

Summary

Maintainability
F
1 wk
Test Coverage

File scene-editor.js has 620 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/** Parts of this file are heavily adapted from https://github.com/mrdoob/three.js/blob/dev/examples/webgl_materials_envmaps.html */

global.THREE = require('three');
const { create, all } = require('mathjs');
const mathjs = create(all, {});
Severity: Major
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 day to fix

Function addObject has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addObject(type, material, name) {
    if (name in screenObjectIds) {
        // Object with that name/ID already exists
        addObject(type, material, name + '+');
        return;
Severity: Major
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 2 hrs to fix

Function addObject has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

function addObject(type, material, name) {
    if (name in screenObjectIds) {
        // Object with that name/ID already exists
        addObject(type, material, name + '+');
        return;
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 2 hrs 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

Function init has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function init() {
    // Cameras
    camera = new THREE.PerspectiveCamera( 70, 16 / 9, 1, SCENE_SIZE * 10 );
    camera.position.set( 1500, 1000, 1500 );
    camera.lookAt( new THREE.Vector3(0, 0, 0) );
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function addAxes has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function addAxes(size) {
    // positive X axis
    var posX = buildAxis(
        new THREE.Vector3( 0, 0, 0 ),
        new THREE.Vector3( size, 0, 0 ),
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function populateInputsFromPaste has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function populateInputsFromPaste(inputDiv) {
    pastedData = inputDiv.val();
    // update both matrix and vector
    if (pastedData.includes('m,') && pastedData.includes(',v,')) {
        // likely to be copied from matrix-simplifier
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function applyTransformation has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function applyTransformation() {
    // Applied matrices need to be 4x4
    var matrix4 = new THREE.Matrix4();
    var transformMatrix;
    var translationVector;
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function getMatrix has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function getMatrix(evalAsString) {
    var col0, col1, col2;
    if (evalAsString) {
        col0 = [
            $('#matrix-row-0-col-0').val(),
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function fillMatrices has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function fillMatrices(isReset) {
    var transform = screenObjectTransforms[suspect.name][0];
    if (transform != null && !isReset) {
        // Transform to be added
        $('#matrix-row-0-col-0').val(transform[0][0]);
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function buildAxis has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function buildAxis( line_start, line_end, colorHex, dashed ) {
    let points = [
        line_start.clone(),
        line_end.clone(),
    ]
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 1 hr to fix

Function applyTransformation has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function applyTransformation() {
    // Applied matrices need to be 4x4
    var matrix4 = new THREE.Matrix4();
    var transformMatrix;
    var translationVector;
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 55 mins 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

Function fillMatrices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function fillMatrices(isReset) {
    var transform = screenObjectTransforms[suspect.name][0];
    if (transform != null && !isReset) {
        // Transform to be added
        $('#matrix-row-0-col-0').val(transform[0][0]);
Severity: Minor
Found in csfieldguide/static/interactives/scene-editor/js/scene-editor.js - About 25 mins 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

    if (evalAsString) {
        col0 = [
            $('#matrix-row-0-col-0').val(),
            $('#matrix-row-1-col-0').val(),
            $('#matrix-row-2-col-0').val()
csfieldguide/static/interactives/matrix-simplifier/js/matrix-simplifier.js on lines 255..273

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

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

fns1.forEach(function(name) {
    const fn = mathjs[name]; // the original function

    const fnNumber = function (x) {
        // convert from degrees to radians
csfieldguide/static/interactives/matrix-simplifier/js/matrix-simplifier.js on lines 32..47

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

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

        case "cone":
            geometry = new THREE.ConeGeometry( 200, 400, 32 );
            object = new THREE.Mesh( geometry, material );
            scene.add( object );
            numCones += 1;
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 394..404
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 406..416

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

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

        case "sphere":
            geometry = new THREE.SphereGeometry( 200, 48, 24 );
            object = new THREE.Mesh( geometry, material );
            scene.add( object );
            numSpheres += 1;
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 406..416
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 418..428

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

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

        case "cube":
            geometry = new THREE.BoxGeometry(400, 400, 400 );
            object = new THREE.Mesh( geometry, material );
            scene.add( object );
            numCubes += 1;
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 394..404
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 418..428

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

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

        col1 = new THREE.Vector3(
            mathjs.evaluate($('#matrix-row-0-col-1').val()),
            mathjs.evaluate($('#matrix-row-1-col-1').val()),
            mathjs.evaluate($('#matrix-row-2-col-1').val())
        );
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 722..726
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 734..738

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

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

        col2 = new THREE.Vector3(
            mathjs.evaluate($('#matrix-row-0-col-2').val()),
            mathjs.evaluate($('#matrix-row-1-col-2').val()),
            mathjs.evaluate($('#matrix-row-2-col-2').val())
            );
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 722..726
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 728..732

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

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

        col0 = new THREE.Vector3(
            mathjs.evaluate($('#matrix-row-0-col-0').val()),
            mathjs.evaluate($('#matrix-row-1-col-0').val()),
            mathjs.evaluate($('#matrix-row-2-col-0').val())
        );
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 728..732
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 734..738

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

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 (!matrix4.equals(new THREE.Matrix4().identity())) {
            // Matrix is not the identity matrix (so there is a transform)
            suspect.applyMatrix4(matrix4);
            addAppliedTransform(getMatrix(true));
        }
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 518..522

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

        if (!matrix4.equals(new THREE.Matrix4().identity())) {
            // Matrix is not the identity matrix (so there is a translation)
            suspect.applyMatrix4(matrix4);
            addAppliedVector(getVector(true));
        }
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 512..516

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

    $('.vector-row input').on('paste', function() {
        var inputDiv = $(this)
        setTimeout(function() {
            populateInputsFromPaste(inputDiv);
        }, 0);
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 144..149

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

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

    } else if (mode == "translation") {
        // vector only
        translationVector = getVector();
        matrix4.makeTranslation(translationVector[0], translationVector[1], translationVector[2]);
        suspect.applyMatrix4(matrix4);
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 495..534

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

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

    $('.matrix-row input').on('paste', function() {
        var inputDiv = $(this)
        setTimeout(function() {
            populateInputsFromPaste(inputDiv);
        }, 0);
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 150..155

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

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 (mode == "transform") {
        // matrix only
        transformMatrix = getMatrix();
        matrix4.makeBasis(transformMatrix[0], transformMatrix[1], transformMatrix[2]);
        suspect.applyMatrix4(matrix4);
csfieldguide/static/interactives/scene-editor/js/scene-editor.js on lines 501..534

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

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