HabitRPG/habitrpg

View on GitHub
test/api/v3/integration/tasks/POST-tasks_user.test.js

Summary

Maintainability
F
2 wks
Test Coverage

File POST-tasks_user.test.js has 716 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { v4 as generateUUID } from 'uuid';
import {
  generateUser,
  sleep,
  translate as t,
Severity: Major
Found in test/api/v3/integration/tasks/POST-tasks_user.test.js - About 1 day to fix

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

        it('creates multiple dailys', async () => {
          const [task, task2] = await user.post('/tasks/user', [{
            text: 'test daily',
            type: 'daily',
            notes: 1976,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 461..481

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

    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('creates multiple todos', async () => {
          const [task, task2] = await user.post('/tasks/user', [{
            text: 'test todo',
            type: 'todo',
            notes: 1976,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 557..577

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

    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('can create checklists', async () => {
          const task = await user.post('/tasks/user', {
            text: 'test daily',
            type: 'daily',
            checklist: [
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 511..526

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

    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('can create checklists', async () => {
          const task = await user.post('/tasks/user', {
            text: 'test todo',
            type: 'todo',
            checklist: [
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 707..722

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

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

        it('updates user.tasksOrder.todos when multiple todos are created', async () => {
          const originalTodosOrderLen = (await user.get('/user')).tasksOrder.todos.length;
          const [task, task2] = await user.post('/tasks/user', [{
            type: 'todo',
            text: 'a todo',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 377..391
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 591..605
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 779..793

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

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

        it('updates user.tasksOrder.dailys when multiple dailys are created', async () => {
          const originalDailysOrderLen = (await user.get('/user')).tasksOrder.dailys.length;
          const [task, task2] = await user.post('/tasks/user', [{
            type: 'daily',
            text: 'a daily',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 377..391
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 495..509
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 779..793

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

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

        it('updates user.tasksOrder.habits when multiple habits are created', async () => {
          const originalHabitsOrderLen = (await user.get('/user')).tasksOrder.habits.length;
          const [task, task2] = await user.post('/tasks/user', [{
            type: 'habit',
            text: 'an habit',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 495..509
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 591..605
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 779..793

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

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

        it('updates user.tasksOrder.dreward when multiple rewards are created', async () => {
          const originalRewardsOrderLen = (await user.get('/user')).tasksOrder.rewards.length;
          const [task, task2] = await user.post('/tasks/user', [{
            type: 'reward',
            text: 'a reward',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 1 day to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 377..391
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 495..509
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 591..605

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

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

        it('updates user.tasksOrder.habits when a new habit is created', async () => {
          const originalHabitsOrderLen = (await user.get('/user')).tasksOrder.habits.length;
          const task = await user.post('/tasks/user', {
            type: 'habit',
            text: 'an habit',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 6 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 483..493
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 579..589
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 767..777

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

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

        it('updates user.tasksOrder.dailys when a new daily is created', async () => {
          const originalDailysOrderLen = (await user.get('/user')).tasksOrder.dailys.length;
          const task = await user.post('/tasks/user', {
            type: 'daily',
            text: 'a daily',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 6 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 365..375
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 483..493
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 767..777

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

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

        it('updates user.tasksOrder.todos when a new todo is created', async () => {
          const originalTodosOrderLen = (await user.get('/user')).tasksOrder.todos.length;
          const task = await user.post('/tasks/user', {
            type: 'todo',
            text: 'a todo',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 6 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 365..375
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 579..589
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 767..777

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

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

        it('updates user.tasksOrder.rewards when a new reward is created', async () => {
          const originalRewardsOrderLen = (await user.get('/user')).tasksOrder.rewards.length;
          const task = await user.post('/tasks/user', {
            type: 'reward',
            text: 'a reward',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 3 other locations - About 6 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 365..375
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 483..493
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 579..589

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

    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('returns an error if reward value is a negative number', async () => {
          await expect(user.post('/tasks/user', {
            type: 'reward',
            text: 'reward with negative value',
            value: -10,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 683..693

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

    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('returns an error if everyX is negative', async () => {
          await expect(user.post('/tasks/user', {
            text: 'test daily',
            type: 'daily',
            everyX: -1,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 63..73

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 93.

    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('cannot create checklists', async () => {
          const task = await user.post('/tasks/user', {
            text: 'test reward',
            type: 'reward',
            checklist: [
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 434..444

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

    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('cannot create checklists', async () => {
          const task = await user.post('/tasks/user', {
            text: 'test habit',
            type: 'habit',
            checklist: [
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 814..824

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

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

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

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

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

    Refactorings

    Further Reading

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

      it('errors if todo due date supplied is an invalid date', async () => {
        await expect(user.post('/tasks/user', {
          type: 'todo',
          text: 'todo text',
          date: 'invalid date',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 2 other locations - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 184..194
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 659..669

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('errors if alias contains invalid values', async () => {
          await expect(user.post('/tasks/user', {
            type: 'todo',
            text: 'todo text',
            alias: 'short name!',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 2 other locations - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 228..238
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 659..669

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

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

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

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

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

    Refactorings

    Further Reading

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

        it('returns an error if the start date is empty', async () => {
          await expect(user.post('/tasks/user', {
            text: 'test daily',
            type: 'daily',
            startDate: '',
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 2 other locations - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 184..194
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 228..238

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

    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('returns an error if everyX is a non int', async () => {
          await expect(user.post('/tasks/user', {
            text: 'test daily',
            type: 'daily',
            everyX: 2.5,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 695..705

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

    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('returns an error if everyX is above 9999', async () => {
          await expect(user.post('/tasks/user', {
            text: 'test daily',
            type: 'daily',
            everyX: 10000,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 671..681

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

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

        it('returns an error if req.body.type is absent', async () => {
          await expect(user.post('/tasks/user', {
            notType: 'habit',
          })).to.eventually.be.rejected.and.eql({
            code: 400,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 5 other locations - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 32..40
    test/api/v3/integration/user/DELETE-user.test.js on lines 30..38
    test/api/v3/integration/user/DELETE-user.test.js on lines 40..48
    test/api/v4/user/POST-user_reset.test.js on lines 100..108
    test/api/v4/user/POST-user_reset.test.js on lines 110..118

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

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

        it('returns an error if req.body.type is not valid', async () => {
          await expect(user.post('/tasks/user', {
            type: 'habitF',
          })).to.eventually.be.rejected.and.eql({
            code: 400,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 5 other locations - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 22..30
    test/api/v3/integration/user/DELETE-user.test.js on lines 30..38
    test/api/v3/integration/user/DELETE-user.test.js on lines 40..48
    test/api/v4/user/POST-user_reset.test.js on lines 100..108
    test/api/v4/user/POST-user_reset.test.js on lines 110..118

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

    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('returns an error if req.body.text is absent', async () => {
          await expect(user.post('/tasks/user', {
            type: 'habit',
          })).to.eventually.be.rejected.and.eql({
            code: 400,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/groups/POST-groups.test.js on lines 15..23

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

    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

          await expect(user.post('/tasks/user', [
            { type: 'habit' }, // Missing text
            { type: 'habit', text: 'valid' }, // Valid
          ])).to.eventually.be.rejected.and.eql({
            code: 400,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 91..98

    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

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

          await expect(user.post('/tasks/user', [
            { type: 'habit' }, // Missing text
            { type: 'habit', text: 'valid' }, // Valid
          ])).to.eventually.be.rejected.and.eql({
            code: 400,
    Severity: Major
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 2 hrs to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 106..113

    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

          expect(taskBodies.find(body => body.task.id === tasks[0].id)).to.exist;
    Severity: Minor
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 35 mins to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 301..301

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

    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

          expect(taskBodies.find(body => body.task.id === tasks[1].id)).to.exist;
    Severity: Minor
    Found in test/api/v3/integration/tasks/POST-tasks_user.test.js and 1 other location - About 35 mins to fix
    test/api/v3/integration/tasks/POST-tasks_user.test.js on lines 300..300

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

    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