FreeAllMedia/dovima

View on GitHub

Showing 148 of 148 total issues

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

  it("should add an order by clause to the query", done => {
    const query = "select * from `users` order by `id` asc";
    const querySpy = User.database.spy(query);

    User
Severity: Major
Found in es6/spec/model/find.orderBy.spec.js and 1 other location - About 2 hrs to fix
es6/spec/model/find.groupBy.spec.js on lines 27..38

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

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

function saveOrUpdate(callback) {
  let now = new Datetime();

  const _ = privateData(this);

Severity: Minor
Found in es6/lib/model/save.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 isPresent has 66 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function isPresent(associationName, callback) {
    const model = this;
    const defaultErrorMessage = "must be present on " + model.constructor.name;

  //apiKey
Severity: Major
Found in es6/lib/validation/isPresent.js - About 2 hrs to fix

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

        orderBy(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                _.query.orderBy(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 225..233
    es6/lib/modelFinder.js on lines 235..243
    es6/lib/modelFinder.js on lines 245..253
    es6/lib/modelFinder.js on lines 255..263
    es6/lib/modelFinder.js on lines 265..273
    es6/lib/modelFinder.js on lines 275..283

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

    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

        whereNull(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                _.query.whereNull(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 225..233
    es6/lib/modelFinder.js on lines 235..243
    es6/lib/modelFinder.js on lines 245..253
    es6/lib/modelFinder.js on lines 265..273
    es6/lib/modelFinder.js on lines 275..283
    es6/lib/modelFinder.js on lines 285..293

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

    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

        where(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                _.query.where(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 235..243
    es6/lib/modelFinder.js on lines 245..253
    es6/lib/modelFinder.js on lines 255..263
    es6/lib/modelFinder.js on lines 265..273
    es6/lib/modelFinder.js on lines 275..283
    es6/lib/modelFinder.js on lines 285..293

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

    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

        orWhere(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                _.query.orWhere(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 225..233
    es6/lib/modelFinder.js on lines 235..243
    es6/lib/modelFinder.js on lines 255..263
    es6/lib/modelFinder.js on lines 265..273
    es6/lib/modelFinder.js on lines 275..283
    es6/lib/modelFinder.js on lines 285..293

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

    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

        whereNotNull(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                _.query.whereNotNull(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 225..233
    es6/lib/modelFinder.js on lines 235..243
    es6/lib/modelFinder.js on lines 245..253
    es6/lib/modelFinder.js on lines 255..263
    es6/lib/modelFinder.js on lines 275..283
    es6/lib/modelFinder.js on lines 285..293

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

    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

        andWhere(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                    _.query.andWhere(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 225..233
    es6/lib/modelFinder.js on lines 245..253
    es6/lib/modelFinder.js on lines 255..263
    es6/lib/modelFinder.js on lines 265..273
    es6/lib/modelFinder.js on lines 275..283
    es6/lib/modelFinder.js on lines 285..293

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

    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

        groupBy(...options) {
            const formattedOptions = this[attributesToColumns](...options);
            const _ = privateData(this);
            if (_.query) {
                _.query.groupBy(...formattedOptions);
    Severity: Major
    Found in es6/lib/modelFinder.js and 6 other locations - About 2 hrs to fix
    es6/lib/modelFinder.js on lines 225..233
    es6/lib/modelFinder.js on lines 235..243
    es6/lib/modelFinder.js on lines 245..253
    es6/lib/modelFinder.js on lines 255..263
    es6/lib/modelFinder.js on lines 265..273
    es6/lib/modelFinder.js on lines 285..293

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

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

        equalTo(query) {
            const ourChain = this.chain;
            const theirChain = query.chain;
    
            let isEqual = true;
    Severity: Minor
    Found in es6/lib/modelFinder.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

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

      describe(`User.find.where("id", "<", 10).orWhere("id", ">", 1)`, () => {
        it("should return a string representation of the chain", () => {
          User
            .find
            .where("id", "<", 10)
    Severity: Major
    Found in es6/spec/model/toString.spec.js and 1 other location - About 2 hrs to fix
    es6/spec/model/toString.spec.js on lines 22..31

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

    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

      describe(`User.find.where("id", "<", 10).andWhere("id", ">", 1)`, () => {
        it("should return a string representation of the chain", () => {
          User
            .find
            .where("id", "<", 10)
    Severity: Major
    Found in es6/spec/model/toString.spec.js and 1 other location - About 2 hrs to fix
    es6/spec/model/toString.spec.js on lines 45..54

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

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

        invalidAttributes(callback) {
            const _ = privateData(this);
            const attributeNamesWithValidators = Object.keys(_.validations);
    
            const compileInvalidAttributeList = (errors, validatorMessages) => {
    Severity: Minor
    Found in es6/lib/model/index.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

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

        describe("(Model.database not set)", () => {
          beforeEach(() => {
            Model.database = undefined;
          });
    
    
    Severity: Major
    Found in es6/spec/model/fetch.spec.js and 1 other location - About 2 hrs to fix
    es6/spec/model/fetch.spec.js on lines 171..181

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

    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

        describe("(Model.database not set)", () => {
          beforeEach(() => {
            Model.database = undefined;
          });
    
    
    Severity: Major
    Found in es6/spec/model/fetch.spec.js and 1 other location - About 2 hrs to fix
    es6/spec/model/fetch.spec.js on lines 248..258

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

    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 fetchByHasOne has 56 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function fetchByHasOne(associationName, associations, callback) {
      const modelFinder = new ModelFinder(this.database);
      const association = associations[associationName];
      const ModelClass = association.constructor;
    
    
    Severity: Major
    Found in es6/lib/model/fetch.js - About 2 hrs to fix

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

                      describe("(belongsTo)", () => {
                          it("should return false when a belongsTo association is not present", done => {
                              truck.street = null;
                              isPresent.call(truck, "street", (error, result) => {
                                  result.should.eql(falseValue);
      Severity: Major
      Found in es6/spec/validation/isPresent.spec.js and 1 other location - About 2 hrs to fix
      es6/spec/validation/isPresent.spec.js on lines 141..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 79.

      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

                      describe("(hasOne)", () => {
                          it("should return false", done => {
                              truck.steeringWheel = null;
                              isPresent.call(truck, "steeringWheel", (error, result) => {
                                  result.should.eql(falseValue);
      Severity: Major
      Found in es6/spec/validation/isPresent.spec.js and 1 other location - About 2 hrs to fix
      es6/spec/validation/isPresent.spec.js on lines 151..159

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

      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

                  it("should accept a custom error message", () => {
                      truck.hasOne("steeringWheel", SteeringWheel);
                      truck.ensure("steeringWheel", isPresent, "must be there.");
                      truck.invalidAttributes((invalidAttributeList) => {
                          invalidAttributeList.should.eql({
      Severity: Major
      Found in es6/spec/model.spec.js and 1 other location - About 2 hrs to fix
      es6/spec/model.spec.js on lines 520..530

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

      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