jmdobry/reheat

View on GitHub
old_test/model/static/relations.test.js

Summary

Maintainability
F
2 wks
Test Coverage

Function relations has 373 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    relations: function (test) {
        var user = new User({
                name: 'John Anderson'
            }),
            user2 = new User({
Severity: Major
Found in old_test/model/static/relations.test.js - About 1 day to fix

    File relations.test.js has 490 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*jshint loopfunc:true*/
    
    var Connection = require('../../../../build/instrument/lib/connection'),
        reheat = require('../../../../build/instrument/lib'),
        utils = require('../../../../build/instrument/lib/support/utils'),
    Severity: Minor
    Found in old_test/model/static/relations.test.js - About 7 hrs to fix

      Function setUp has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          setUp: function (cb) {
              connection = new Connection();
              connection.run(r.dbList())
                  .then(function (dbList) {
                      if (utils.contains(dbList, 'test')) {
      Severity: Major
      Found in old_test/model/static/relations.test.js - About 3 hrs to fix

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

                user.save()
                    .then(function (user) {
                        profile.setSync('userId', user.get(User.idAttribute));
                        post1.setSync('userId', user.get(User.idAttribute));
                        post2.setSync('userId', user.get(User.idAttribute));
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 5 days to fix
        old_test/model/static/filter.relations.test.js on lines 176..245

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

        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

            setUp: function (cb) {
                connection = new Connection();
                connection.run(r.dbList())
                    .then(function (dbList) {
                        if (utils.contains(dbList, 'test')) {
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 2 days to fix
        old_test/model/static/filter.relations.test.js on lines 13..103

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

        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

                var user = new User({
                        name: 'John Anderson'
                    }),
                    user2 = new User({
                        name: 'Sally Jones'
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 1 day to fix
        old_test/model/static/filter.relations.test.js on lines 124..174

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

        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

            tearDown: function (cb) {
                connection.run(r.dbList())
                    .then(function (dbList) {
                        if (utils.contains(dbList, 'test')) {
                            return connection.run(r.dbDrop('test'));
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 6 hrs to fix
        old_test/model/static/filter.relations.test.js on lines 105..122

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

        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

                        var JSONposts = [
                            {
                                title: 'post1',
                                id: post1.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute)
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 4 hrs to fix
        old_test/model/static/relations.test.js on lines 405..421

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

        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

                        var JSONposts = [
                            {
                                title: 'post1',
                                id: post1.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute)
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 4 hrs to fix
        old_test/model/static/relations.test.js on lines 347..363

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

        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

                        var JSONposts = [
                            {
                                title: 'post3',
                                id: post3.get(Post.idAttribute),
                                userId: tempUser2.get(User.idAttribute)
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 2 hrs to fix
        old_test/model/static/relations.test.js on lines 498..509

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

        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

                        var JSONposts = [
                            {
                                title: 'post3',
                                id: post3.get(Post.idAttribute),
                                userId: tempUser2.get(User.idAttribute)
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 2 hrs to fix
        old_test/model/static/relations.test.js on lines 551..562

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

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

                            {
                                id: comment1.get(Comment.idAttribute),
                                postId: post2.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute),
                                content: comment1.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 575..580
        old_test/model/static/relations.test.js on lines 581..586

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

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

                            {
                                id: comment7.get(Comment.idAttribute),
                                postId: post3.get(Post.idAttribute),
                                userId: tempUser2.get(User.idAttribute),
                                content: comment7.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 581..586

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

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

                            {
                                id: comment8.get(Comment.idAttribute),
                                postId: post3.get(Post.idAttribute),
                                userId: tempUser2.get(User.idAttribute),
                                content: comment8.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 575..580

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

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

                            {
                                id: comment2.get(Comment.idAttribute),
                                postId: post5.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute),
                                content: comment2.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 575..580
        old_test/model/static/relations.test.js on lines 581..586

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

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

                            {
                                id: comment5.get(Comment.idAttribute),
                                postId: post5.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute),
                                content: comment5.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 575..580
        old_test/model/static/relations.test.js on lines 581..586

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

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

                            {
                                id: comment6.get(Comment.idAttribute),
                                postId: post3.get(Post.idAttribute),
                                userId: tempUser2.get(User.idAttribute),
                                content: comment6.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 575..580
        old_test/model/static/relations.test.js on lines 581..586

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

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

                            {
                                id: comment4.get(Comment.idAttribute),
                                postId: post5.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute),
                                content: comment4.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 440..445
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 575..580
        old_test/model/static/relations.test.js on lines 581..586

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

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

                            {
                                id: comment3.get(Comment.idAttribute),
                                postId: post5.get(Post.idAttribute),
                                userId: tempUser.get(User.idAttribute),
                                content: comment3.get('content')
        Severity: Major
        Found in old_test/model/static/relations.test.js and 7 other locations - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 428..433
        old_test/model/static/relations.test.js on lines 434..439
        old_test/model/static/relations.test.js on lines 446..451
        old_test/model/static/relations.test.js on lines 452..457
        old_test/model/static/relations.test.js on lines 569..574
        old_test/model/static/relations.test.js on lines 575..580
        old_test/model/static/relations.test.js on lines 581..586

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

        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

                        var posts = tempUser2.get(User.relations.hasMany.Post.localField),
                            comments = tempUser2.get(User.relations.hasMany.Comment.localField);
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 389..390

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

        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

                        var posts = tempUser.get(User.relations.hasMany.Post.localField),
                            comments = tempUser.get(User.relations.hasMany.Comment.localField);
        Severity: Major
        Found in old_test/model/static/relations.test.js and 1 other location - About 1 hr to fix
        old_test/model/static/relations.test.js on lines 535..536

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

        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

                        test.deepEqual(userJSON, {
                            id: tempUser.get(User.idAttribute),
                            name: 'John Anderson',
                            posts: JSONposts,
                            comments: JSONcomments
        Severity: Minor
        Found in old_test/model/static/relations.test.js and 1 other location - About 30 mins to fix
        old_test/model/static/relations.test.js on lines 601..606

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

        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

                        test.deepEqual(userJSON, {
                            id: tempUser2.get(User.idAttribute),
                            name: 'Sally Jones',
                            posts: JSONposts,
                            comments: JSONcomments
        Severity: Minor
        Found in old_test/model/static/relations.test.js and 1 other location - About 30 mins to fix
        old_test/model/static/relations.test.js on lines 472..477

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

        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