Showing 10,536 of 10,536 total issues

Function on_get has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    def on_get(req, resp, id_):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
            access_control(req)
Severity: Minor
Found in myems-api/core/combinedequipment.py - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Function on_get has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

    def on_get(req, resp):
        if 'API-KEY' not in req.headers or \
                not isinstance(req.headers['API-KEY'], str) or \
                len(str.strip(req.headers['API-KEY'])) == 0:
            access_control(req)
Severity: Minor
Found in myems-api/core/notification.py - About 6 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2],
                              "energy_category": energy_category_dict.get(row[3], None),
                              "is_output": bool(row[4])}
Severity: Major
Found in myems-api/core/combinedequipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2],
                              "energy_category": energy_category_dict.get(row[3], None),
                              "is_output": bool(row[4])}
Severity: Major
Found in myems-api/core/combinedequipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2],
                              "energy_category": energy_category_dict.get(row[3], None),
                              "is_output": bool(row[4])}
Severity: Major
Found in myems-api/core/combinedequipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0],
                              "name": row[1],
                              "uuid": row[2],
Severity: Major
Found in myems-api/core/equipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0],
                              "name": row[1],
                              "uuid": row[2],
Severity: Major
Found in myems-api/core/equipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0],
                              "name": row[1],
                              "uuid": row[2],
Severity: Major
Found in myems-api/core/equipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0],
                              "name": row[1],
                              "uuid": row[2],
Severity: Major
Found in myems-api/core/equipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2],
                              "energy_category": energy_category_dict.get(row[3], None),
                              "is_output": bool(row[4])}
Severity: Major
Found in myems-api/core/combinedequipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2],
                              "energy_category": energy_category_dict.get(row[3], None),
                              "is_output": bool(row[4])}
Severity: Major
Found in myems-api/core/combinedequipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0], "name": row[1], "uuid": row[2],
                              "energy_category": energy_category_dict.get(row[3], None),
                              "is_output": bool(row[4])}
Severity: Major
Found in myems-api/core/combinedequipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0],
                              "name": row[1],
                              "uuid": row[2],
Severity: Major
Found in myems-api/core/equipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2821..2829
myems-api/core/equipment.py on lines 2838..2846

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

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

            if rows is not None and len(rows) > 0:
                for row in rows:
                    result = {"id": row[0],
                              "name": row[1],
                              "uuid": row[2],
Severity: Major
Found in myems-api/core/equipment.py and 11 other locations - About 6 hrs to fix
myems-api/core/combinedequipment.py on lines 2397..2403
myems-api/core/combinedequipment.py on lines 2425..2431
myems-api/core/combinedequipment.py on lines 2453..2459
myems-api/core/combinedequipment.py on lines 3070..3076
myems-api/core/combinedequipment.py on lines 3098..3104
myems-api/core/combinedequipment.py on lines 3126..3132
myems-api/core/equipment.py on lines 2202..2210
myems-api/core/equipment.py on lines 2219..2227
myems-api/core/equipment.py on lines 2236..2244
myems-api/core/equipment.py on lines 2804..2812
myems-api/core/equipment.py on lines 2821..2829

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

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

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

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

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

Refactorings

Further Reading

File Flex.js has 454 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Fragment } from 'react';
import { Card, CardHeader, CardBody } from 'reactstrap';
import FalconEditor from '../common/FalconEditor';
import PageHeader from '../common/PageHeader';

Severity: Minor
Found in myems-web/src/components/utilities/Flex.js - About 6 hrs to fix

    Function ProductDetailsFooter has 172 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ProductDetailsFooter = () => {
      const [activeTab, setActiveTab] = useState('description');
      const [indicatorLeft, setIndicatorLeft] = useState(null);
      const [indicatorRight, setIndicatorRight] = useState(null);
      const [currentTabIndex, setCurrentTabIndex] = useState(null);

      File user.controller.js has 453 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      'use strict';
      
      app.controller('UserController', function ($scope,
          $rootScope,
          $window,
      Severity: Minor
      Found in myems-admin/app/controllers/users/user/user.controller.js - About 6 hrs to fix

        File Buttons.js has 452 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { Fragment } from 'react';
        import { Button, Card, CardHeader, CardBody } from 'reactstrap';
        import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
        import PageHeader from '../common/PageHeader';
        import FalconCardHeader from '../common/FalconCardHeader';
        Severity: Minor
        Found in myems-web/src/components/bootstrap-components/Buttons.js - About 6 hrs to fix

          File energystoragecontainerbattery.controller.js has 451 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          'use strict';
          
          app.controller('EnergyStorageContainerBatteryController', function(
              $scope,
              $rootScope,

            File metercomparison.py has 451 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import re
            from datetime import datetime, timedelta, timezone
            from decimal import Decimal
            import falcon
            import mysql.connector
            Severity: Minor
            Found in myems-api/reports/metercomparison.py - About 6 hrs to fix
              Severity
              Category
              Status
              Source
              Language