xiazeyu/live2d-widget.js

View on GitHub

Showing 9,694 of 9,694 total issues

File live2d.core.js has 7593 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * ============================================================
 *   Live2D Cubism SDK for WebGL Version 2.1.00_1
 *
 *   (c) Live2D Inc.
Severity: Major
Found in src/lib/live2d.core.js - About 3 wks to fix

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

    L2DPhysics.load            = function(buf /*byte[]*/ )
    {
        var ret = new L2DPhysics(); //L2DPhysicsL2DPhysics
        var pm = Live2DFramework.getPlatformManager();
        var json = pm.jsonParseFromBytes(buf);
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js and 1 other location - About 4 days to fix
    src/lib/Live2DFramework.js on lines 891..951

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

    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

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

    L2DPhysics.load = function (buf /*byte[]*/) {
        var ret = new L2DPhysics(); //L2DPhysicsL2DPhysics
        var pm = Live2DFramework.getPlatformManager();
        var json = pm.jsonParseFromBytes(buf);
        var params = json.physics_hair;
    Severity: Major
    Found in src/lib/Live2DFramework.js and 1 other location - About 4 days to fix
    src/lib/_Live2DFramework.official.js on lines 974..1035

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

    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 loadMotion has a Cognitive Complexity of 186 (exceeds 5 allowed). Consider refactoring.
    Open

    ao.loadMotion = function(aT) {
        if (aT instanceof ArrayBuffer) {
            aT = new DataView(aT);
        }
        var aN = new ao();
    Severity: Minor
    Found in src/lib/live2d.core.js - About 3 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

    Function loadMotion has a Cognitive Complexity of 185 (exceeds 5 allowed). Consider refactoring.
    Open

    Y.loadMotion = function(aR) {
        var aM = new Y();
        var aI = [0];
        var aP = aR.length;
        aM._$yT = 0;
    Severity: Minor
    Found in src/lib/live2d.core.js - About 3 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

    Function transformPoints_sdk2 has a Cognitive Complexity of 175 (exceeds 5 allowed). Consider refactoring.
    Open

    E.transformPoints_sdk2 = function(a0, bc, a5, aP, aI, aR, aQ, aU) {
        var aW = a5 * aI;
        var aV;
        var bn, bm;
        var aT = 0;
    Severity: Minor
    Found in src/lib/live2d.core.js - About 3 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

    L2DTargetPoint.prototype.update = function () {
        var TIME_TO_MAX_SPEED = 0.15;
        var FACE_PARAM_MAX_V = 40.0 / 7.5;
        var MAX_V = FACE_PARAM_MAX_V / L2DTargetPoint.FRAME_RATE;
        if (this.lastTimeSec == 0) {
    Severity: Major
    Found in src/lib/Live2DFramework.js and 1 other location - About 3 days to fix
    src/lib/_Live2DFramework.official.js on lines 1299..1340

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

    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

    L2DTargetPoint.prototype.update          = function()
    {
       var TIME_TO_MAX_SPEED = 0.15;
       var FACE_PARAM_MAX_V = 40.0 / 7.5;
       var MAX_V = FACE_PARAM_MAX_V / L2DTargetPoint.FRAME_RATE;
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js and 1 other location - About 3 days to fix
    src/lib/Live2DFramework.js on lines 1188..1228

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

    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

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

    L2DExpressionMotion.loadJson = function (buf) {
        var ret = new L2DExpressionMotion();
    
        var pm = Live2DFramework.getPlatformManager();
        var json = pm.jsonParseFromBytes(buf);
    Severity: Major
    Found in src/lib/Live2DFramework.js and 1 other location - About 3 days to fix
    src/lib/_Live2DFramework.official.js on lines 353..407

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

    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

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

    L2DExpressionMotion.loadJson        = function(buf)
    {    
        var ret = new L2DExpressionMotion();
        
        var pm = Live2DFramework.getPlatformManager();
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js and 1 other location - About 3 days to fix
    src/lib/Live2DFramework.js on lines 353..406

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

    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

    L2DPose.prototype.normalizePartsOpacityGroup = function (model/*ALive2DModel*/, partsGroup/*L2DPartsParam[]*/, deltaTimeSec/*float*/) {
        var visibleParts = -1;
        var visibleOpacity = 1.0;
        var CLEAR_TIME_SEC = 0.5;
        var phi = 0.5;
    Severity: Major
    Found in src/lib/Live2DFramework.js and 1 other location - About 2 days to fix
    src/lib/_Live2DFramework.official.js on lines 1152..1202

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

    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

    L2DPose.prototype.normalizePartsOpacityGroup = function(model/*ALive2DModel*/, partsGroup/*L2DPartsParam[]*/, deltaTimeSec/*float*/)
    {
        var visibleParts = -1;
        var visibleOpacity = 1.0;
        var CLEAR_TIME_SEC = 0.5;
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js and 1 other location - About 2 days to fix
    src/lib/Live2DFramework.js on lines 1055..1104

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

    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

    L2DEyeBlink.prototype.updateParam = function (model/*ALive2DModel*/) {
        var time /*:long*/ = UtSystem.getUserTimeMSec();
        var eyeParamValue /*:Number*/;
        var t /*:Number*/ = 0;
        switch (this.eyeState) {
    Severity: Major
    Found in src/lib/Live2DFramework.js and 1 other location - About 2 days to fix
    src/lib/_Live2DFramework.official.js on lines 501..550

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

    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

    L2DEyeBlink.prototype.updateParam     = function(model/*ALive2DModel*/)
    {
        var time /*:long*/ = UtSystem.getUserTimeMSec();
        var eyeParamValue /*:Number*/;
        var t /*:Number*/ = 0;
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js and 1 other location - About 2 days to fix
    src/lib/Live2DFramework.js on lines 486..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 489.

    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

    L2DViewMatrix.prototype.adjustTranslate = function(shiftX/*float*/, shiftY/*float*/)
    {
        if(this.tr[0] * this.maxLeft + (this.tr[12] + shiftX) > this.screenLeft) 
            shiftX = this.screenLeft - this.tr[0] * this.maxLeft - this.tr[12];
        if(this.tr[0] * this.maxRight + (this.tr[12] + shiftX) < this.screenRight) 
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js and 1 other location - About 2 days to fix
    src/lib/Live2DFramework.js on lines 1252..1267

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

    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

    L2DViewMatrix.prototype.adjustTranslate = function (shiftX/*float*/, shiftY/*float*/) {
        if (this.tr[0] * this.maxLeft + (this.tr[12] + shiftX) > this.screenLeft)
            shiftX = this.screenLeft - this.tr[0] * this.maxLeft - this.tr[12];
        if (this.tr[0] * this.maxRight + (this.tr[12] + shiftX) < this.screenRight)
            shiftX = this.screenRight - this.tr[0] * this.maxRight - this.tr[12];
    Severity: Major
    Found in src/lib/Live2DFramework.js and 1 other location - About 2 days to fix
    src/lib/_Live2DFramework.official.js on lines 1422..1438

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

    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

    ac.prototype.rotateZ = function(aH) {
        var aK = aC.fcos(aH);
        var aJ = aC._$9(aH);
        var aI = this.m[0];
        this.m[0] = aI * aK + this.m[4] * aJ;
    Severity: Major
    Found in src/lib/live2d.core.js and 1 other location - About 2 days to fix
    src/lib/live2d.core.js on lines 2624..2640

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

    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

    ac.prototype.rotateX = function(aH) {
        var aK = aC.fcos(aH);
        var aJ = aC._$9(aH);
        var aI = this.m[4];
        this.m[4] = aI * aK + this.m[8] * aJ;
    Severity: Major
    Found in src/lib/live2d.core.js and 1 other location - About 2 days to fix
    src/lib/live2d.core.js on lines 2658..2674

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

    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 _Live2DFramework.official.js has 914 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     *
     *  You can modify and use this source freely
     *  only for the development of application related Live2D.
     *
    Severity: Major
    Found in src/lib/_Live2DFramework.official.js - About 2 days to fix

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

      L2DPose.load = function (buf/*byte[]*/) {
          var ret = new L2DPose(); //L2DPose
          var pm = Live2DFramework.getPlatformManager();
          var json = pm.jsonParseFromBytes(buf);
          var poseListInfo = json.parts_visible; //Value
      Severity: Major
      Found in src/lib/Live2DFramework.js and 1 other location - About 2 days to fix
      src/lib/_Live2DFramework.official.js on lines 1072..1101

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

      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