spmcbride1201/cookie-monsters

View on GitHub

Showing 42 of 42 total issues

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

        <div className="form-group">
          <label htmlFor="shippingState">State</label>
          <input type="text" className="form-control" id="shippingState" aria-describedby="shippingState" value={user.shippingState} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="billingState">State</label>
          <input type="text" className="form-control" id="billingState" aria-describedby="billingState" value={user.billingState} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="shippingAddress">Address</label>
          <input type="text" className="form-control" id="shippingAddress" aria-describedby="shippingAddress" value={user.shippingAddress} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="billingZip">Zip Code</label>
          <input type="text" className="form-control" id="billingZip" aria-describedby="billingZip" value={user.billingZip} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="name">Name</label>
          <input type="text" className="form-control" id="name" aria-describedby="emailHelp" value={user.name} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="billingCity">City</label>
          <input type="text" className="form-control" id="billingCity" aria-describedby="billingCity" value={user.billingCity} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="shippingZip">Zip Code</label>
          <input type="text" className="form-control" id="shippingZip" aria-describedby="shippingZip" value={user.billingZip} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="billingAddress">Address</label>
          <input type="text" className="form-control" id="billingAddress" aria-describedby="billingAddress" value={user.billingAddress} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 46..49
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

        <div className="form-group">
          <label htmlFor="shippingCity">City</label>
          <input type="text" className="form-control" id="shippingCity" aria-describedby="shippingCity" value={user.shippingCity} />
        </div>
Severity: Major
Found in app/components/User.jsx and 8 other locations - About 1 hr to fix
app/components/User.jsx on lines 15..18
app/components/User.jsx on lines 25..28
app/components/User.jsx on lines 29..32
app/components/User.jsx on lines 33..36
app/components/User.jsx on lines 37..40
app/components/User.jsx on lines 42..45
app/components/User.jsx on lines 50..53
app/components/User.jsx on lines 54..57

Duplicated Code

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

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

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

Tuning

This issue has a mass of 74.

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

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

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

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

Refactorings

Further Reading

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

    .get('/', (req, res, next) => {
        console.log("get /api/orders/");
        // .get('/', mustBeLoggedIn, (req, res, next) => {
        if (req.user && req.user.isAdmin) {
            console.log("is an admin");
Severity: Minor
Found in server/orders.js - About 1 hr to fix

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

      describe('PUT / (????)', () => {
        // Modify a cookie by id
        xit('modifies the characteristics of a type of cookie', () =>
          request(app)
            .post('/api/reviews')
    Severity: Major
    Found in server/products.test.js and 1 other location - About 1 hr to fix
    server/products.test.js on lines 59..71

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

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

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

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

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

    Refactorings

    Further Reading

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

      describe('DELETE /:id', () => {
        // Modify a cookie by id
        xit('removes a type of cookie', () =>
          request(app)
            .post('/api/reviews')
    Severity: Major
    Found in server/products.test.js and 1 other location - About 1 hr to fix
    server/products.test.js on lines 45..57

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

    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

                <tr>
                  <td></td>
                  <td className="pull-right orderTableFooterTitles">Flat Shipping Rate</td>
                  <td>${props.order.shippingRate}</td>
                </tr>
    Severity: Major
    Found in app/components/Order.jsx and 1 other location - About 1 hr to fix
    app/components/Order.jsx on lines 30..34

    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

                <tr>
                  <td></td>
                  <td className="pull-right orderTableFooterTitles">Total</td>
                  <td>${props.order.total}</td>
                </tr>
    Severity: Major
    Found in app/components/Order.jsx and 1 other location - About 1 hr to fix
    app/components/Order.jsx on lines 25..29

    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

    Function reducer has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    const reducer = (lineItems = [], action) => {
    
      switch (action.type) {
        case ADD_TO_CART:
          console.log("Starting ADD_TO_CART");
    Severity: Minor
    Found in app/reducers/cart.jsx - About 1 hr to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function reducer has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const reducer = (lineItems = [], action) => {
    
      switch (action.type) {
        case ADD_TO_CART:
          console.log("Starting ADD_TO_CART");
    Severity: Minor
    Found in app/reducers/cart.jsx - About 1 hr to fix

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

      export function submitOrder(cart) {
        [
          {
            product: {},
            quantity: 1
      Severity: Minor
      Found in app/reducers/orders.jsx - About 1 hr to fix

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

              <div>
                <img className="cookieMonsterImg" src='/images/cookie-monster.jpg' />
                <h1>Cookie Monsters</h1>
                <h3 className="subtitle">Home of the world's greatest cookies</h3>
              </div>
        Severity: Minor
        Found in app/components/Order.jsx and 1 other location - About 50 mins to fix
        app/components/Hero.jsx on lines 7..11

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

        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

              <div className="col-sm-6 col-xs-12">
                <img className="cookieMonsterImg" src='/images/cookie-monster.jpg' />
                <h1>Cookie Monsters</h1>
                <h3 className="subtitle">Home of the world's greatest cookies</h3>
              </div>
        Severity: Minor
        Found in app/components/Hero.jsx and 1 other location - About 50 mins to fix
        app/components/Order.jsx on lines 9..13

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

        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

                return User.create(req.body)
                    .then(user => res.status(201).json(user))
                    .catch(next)
        Severity: Minor
        Found in server/users.js and 1 other location - About 40 mins to fix
        server/reviews.js on lines 18..20

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

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

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

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

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

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language