myems-api/core/shopfloor.py

Summary

Maintainability
F
5 mos
Test Coverage

File shopfloor.py has 2489 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import uuid
from datetime import datetime, timedelta
import falcon
import mysql.connector
import simplejson as json
Severity: Major
Found in myems-api/core/shopfloor.py - About 6 days to fix

    Function on_post has a Cognitive Complexity of 202 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_post(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/shopfloor.py - About 4 days 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_post has a Cognitive Complexity of 104 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_post(req, resp):
            """Handles POST requests"""
            admin_control(req)
            try:
                raw_json = req.stream.read().decode('utf-8')
    Severity: Minor
    Found in myems-api/core/shopfloor.py - About 2 days 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 87 (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/shopfloor.py - About 1 day 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_put has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_put(req, resp, id_):
            """Handles PUT requests"""
            admin_control(req)
            try:
                raw_json = req.stream.read().decode('utf-8')
    Severity: Minor
    Found in myems-api/core/shopfloor.py - About 3 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_post has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_post(req, resp):
            """Handles POST requests"""
            admin_control(req)
            try:
                raw_json = req.stream.read().decode('utf-8')
    Severity: Minor
    Found in myems-api/core/shopfloor.py - About 3 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 15 (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/shopfloor.py - 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 on_get has a Cognitive Complexity of 14 (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/shopfloor.py - 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 on_get has a Cognitive Complexity of 12 (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/shopfloor.py - 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 on_get has a Cognitive Complexity of 12 (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/shopfloor.py - 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 on_get has a Cognitive Complexity of 12 (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/shopfloor.py - 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 on_get has a Cognitive Complexity of 12 (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/shopfloor.py - 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 on_post has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def on_post(req, resp):
            """Handles POST requests"""
            admin_control(req)
            try:
                raw_json = req.stream.read().decode('utf-8')
    Severity: Minor
    Found in myems-api/core/shopfloor.py - About 1 hr to fix

      Function on_put has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def on_put(req, resp, id_):
              """Handles PUT requests"""
              admin_control(req)
              try:
                  raw_json = req.stream.read().decode('utf-8')
      Severity: Minor
      Found in myems-api/core/shopfloor.py - About 1 hr to fix

        Function on_post has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def on_post(req, resp):
                """Handles POST requests"""
                admin_control(req)
                try:
                    raw_json = req.stream.read().decode('utf-8')
        Severity: Minor
        Found in myems-api/core/shopfloor.py - About 1 hr to fix

          Function on_get has a Cognitive Complexity of 9 (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/shopfloor.py - About 55 mins 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 8 (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/shopfloor.py - About 45 mins 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 8 (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/shopfloor.py - About 45 mins 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 8 (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/shopfloor.py - About 45 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_post(req, resp, id_):
                  """Handles POST requests"""
                  admin_control(req)
                  try:
                      raw_json = req.stream.read().decode('utf-8')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 35 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, sid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, eid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, mid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, pid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, cid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, mid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, mid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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_delete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def on_delete(req, resp, id_, wcid):
                  admin_control(req)
                  if not id_.isdigit() or int(id_) <= 0:
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                             description='API.INVALID_SHOPFLOOR_ID')
          Severity: Minor
          Found in myems-api/core/shopfloor.py - About 25 mins 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

          class ShopfloorOfflineMeterCollection:
              def __init__(self):
                  """Initializes ShopfloorOfflineMeterCollection"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 11 other locations - About 1 wk to fix
          myems-api/core/shopfloor.py on lines 634..759
          myems-api/core/shopfloor.py on lines 1374..1499
          myems-api/core/space.py on lines 1344..1469
          myems-api/core/space.py on lines 1710..1835
          myems-api/core/space.py on lines 2787..2912
          myems-api/core/store.py on lines 577..702
          myems-api/core/store.py on lines 765..890
          myems-api/core/store.py on lines 1317..1442
          myems-api/core/tenant.py on lines 675..802
          myems-api/core/tenant.py on lines 865..992
          myems-api/core/tenant.py on lines 1423..1550

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

          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

          class ShopfloorMeterCollection:
              def __init__(self):
                  """Initializes ShopfloorMeterCollection"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 11 other locations - About 1 wk to fix
          myems-api/core/shopfloor.py on lines 822..947
          myems-api/core/shopfloor.py on lines 1374..1499
          myems-api/core/space.py on lines 1344..1469
          myems-api/core/space.py on lines 1710..1835
          myems-api/core/space.py on lines 2787..2912
          myems-api/core/store.py on lines 577..702
          myems-api/core/store.py on lines 765..890
          myems-api/core/store.py on lines 1317..1442
          myems-api/core/tenant.py on lines 675..802
          myems-api/core/tenant.py on lines 865..992
          myems-api/core/tenant.py on lines 1423..1550

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

          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

          class ShopfloorVirtualMeterCollection:
              def __init__(self):
                  """Initializes ShopfloorVirtualMeterCollection"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 11 other locations - About 1 wk to fix
          myems-api/core/shopfloor.py on lines 634..759
          myems-api/core/shopfloor.py on lines 822..947
          myems-api/core/space.py on lines 1344..1469
          myems-api/core/space.py on lines 1710..1835
          myems-api/core/space.py on lines 2787..2912
          myems-api/core/store.py on lines 577..702
          myems-api/core/store.py on lines 765..890
          myems-api/core/store.py on lines 1317..1442
          myems-api/core/tenant.py on lines 675..802
          myems-api/core/tenant.py on lines 865..992
          myems-api/core/tenant.py on lines 1423..1550

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

          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

          class ShopfloorPointCollection:
              def __init__(self):
                  """Initializes ShopfloorPointCollection"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 3 other locations - About 1 wk to fix
          myems-api/core/space.py on lines 1899..2023
          myems-api/core/store.py on lines 954..1078
          myems-api/core/tenant.py on lines 1056..1182

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

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

          class ShopfloorEquipmentCollection:
              def __init__(self):
                  """Initializes ShopfloorEquipmentCollection"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 24 other locations - About 1 wk to fix
          myems-api/core/combinedequipment.py on lines 2098..2210
          myems-api/core/equipment.py on lines 1914..2028
          myems-api/core/meter.py on lines 1142..1254
          myems-api/core/shopfloor.py on lines 1199..1311
          myems-api/core/shopfloor.py on lines 1563..1675
          myems-api/core/shopfloor.py on lines 1739..1851
          myems-api/core/space.py on lines 817..929
          myems-api/core/space.py on lines 993..1105
          myems-api/core/space.py on lines 1169..1281
          myems-api/core/space.py on lines 1534..1646
          myems-api/core/space.py on lines 2087..2199
          myems-api/core/space.py on lines 2262..2374
          myems-api/core/space.py on lines 2437..2549
          myems-api/core/space.py on lines 2612..2724
          myems-api/core/space.py on lines 3161..3273
          myems-api/core/space.py on lines 3337..3449
          myems-api/core/space.py on lines 5167..5279
          myems-api/core/store.py on lines 1142..1254
          myems-api/core/store.py on lines 1506..1618
          myems-api/core/store.py on lines 1682..1794
          myems-api/core/tenant.py on lines 1246..1360
          myems-api/core/tenant.py on lines 1614..1728
          myems-api/core/tenant.py on lines 1792..1906
          myems-api/core/virtualpowerplant.py on lines 435..547

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

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

          class ShopfloorSensorCollection:
              def __init__(self):
                  """Initializes ShopfloorSensorCollection"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 24 other locations - About 1 wk to fix
          myems-api/core/combinedequipment.py on lines 2098..2210
          myems-api/core/equipment.py on lines 1914..2028
          myems-api/core/meter.py on lines 1142..1254
          myems-api/core/shopfloor.py on lines 458..570
          myems-api/core/shopfloor.py on lines 1563..1675
          myems-api/core/shopfloor.py on lines 1739..1851
          myems-api/core/space.py on lines 817..929
          myems-api/core/space.py on lines 993..1105
          myems-api/core/space.py on lines 1169..1281
          myems-api/core/space.py on lines 1534..1646
          myems-api/core/space.py on lines 2087..2199
          myems-api/core/space.py on lines 2262..2374
          myems-api/core/space.py on lines 2437..2549
          myems-api/core/space.py on lines 2612..2724
          myems-api/core/space.py on lines 3161..3273
          myems-api/core/space.py on lines 3337..3449
          myems-api/core/space.py on lines 5167..5279
          myems-api/core/store.py on lines 1142..1254
          myems-api/core/store.py on lines 1506..1618
          myems-api/core/store.py on lines 1682..1794
          myems-api/core/tenant.py on lines 1246..1360
          myems-api/core/tenant.py on lines 1614..1728
          myems-api/core/tenant.py on lines 1792..1906
          myems-api/core/virtualpowerplant.py on lines 435..547

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

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

          class ShopfloorWorkingCalendarCollection:
              def __init__(self):
                  """Initializes ShopfloorWorkingCalendarCollection Class"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 24 other locations - About 1 wk to fix
          myems-api/core/combinedequipment.py on lines 2098..2210
          myems-api/core/equipment.py on lines 1914..2028
          myems-api/core/meter.py on lines 1142..1254
          myems-api/core/shopfloor.py on lines 458..570
          myems-api/core/shopfloor.py on lines 1199..1311
          myems-api/core/shopfloor.py on lines 1739..1851
          myems-api/core/space.py on lines 817..929
          myems-api/core/space.py on lines 993..1105
          myems-api/core/space.py on lines 1169..1281
          myems-api/core/space.py on lines 1534..1646
          myems-api/core/space.py on lines 2087..2199
          myems-api/core/space.py on lines 2262..2374
          myems-api/core/space.py on lines 2437..2549
          myems-api/core/space.py on lines 2612..2724
          myems-api/core/space.py on lines 3161..3273
          myems-api/core/space.py on lines 3337..3449
          myems-api/core/space.py on lines 5167..5279
          myems-api/core/store.py on lines 1142..1254
          myems-api/core/store.py on lines 1506..1618
          myems-api/core/store.py on lines 1682..1794
          myems-api/core/tenant.py on lines 1246..1360
          myems-api/core/tenant.py on lines 1614..1728
          myems-api/core/tenant.py on lines 1792..1906
          myems-api/core/virtualpowerplant.py on lines 435..547

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

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

          class ShopfloorCommandCollection:
              def __init__(self):
                  """Initializes Class"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 24 other locations - About 1 wk to fix
          myems-api/core/combinedequipment.py on lines 2098..2210
          myems-api/core/equipment.py on lines 1914..2028
          myems-api/core/meter.py on lines 1142..1254
          myems-api/core/shopfloor.py on lines 458..570
          myems-api/core/shopfloor.py on lines 1199..1311
          myems-api/core/shopfloor.py on lines 1563..1675
          myems-api/core/space.py on lines 817..929
          myems-api/core/space.py on lines 993..1105
          myems-api/core/space.py on lines 1169..1281
          myems-api/core/space.py on lines 1534..1646
          myems-api/core/space.py on lines 2087..2199
          myems-api/core/space.py on lines 2262..2374
          myems-api/core/space.py on lines 2437..2549
          myems-api/core/space.py on lines 2612..2724
          myems-api/core/space.py on lines 3161..3273
          myems-api/core/space.py on lines 3337..3449
          myems-api/core/space.py on lines 5167..5279
          myems-api/core/store.py on lines 1142..1254
          myems-api/core/store.py on lines 1506..1618
          myems-api/core/store.py on lines 1682..1794
          myems-api/core/tenant.py on lines 1246..1360
          myems-api/core/tenant.py on lines 1614..1728
          myems-api/core/tenant.py on lines 1792..1906
          myems-api/core/virtualpowerplant.py on lines 435..547

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

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

          class ShopfloorOfflineMeterItem:
              def __init__(self):
                  """Initializes ShopfloorOfflineMeterItem"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorEquipmentItem:
              def __init__(self):
                  """Initializes ShopfloorEquipmentItem"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorPointItem:
              def __init__(self):
                  """Initializes ShopfloorPointItem"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorWorkingCalendarItem:
              def __init__(self):
                  """Initializes ShopfloorWorkingCalendarItem Class"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorCommandItem:
              def __init__(self):
                  """Initializes Class"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorVirtualMeterItem:
              def __init__(self):
                  """Initializes ShopfloorVirtualMeterItem"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorSensorItem:
              def __init__(self):
                  """Initializes ShopfloorSensorItem"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 762..819
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

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

          class ShopfloorMeterItem:
              def __init__(self):
                  """Initializes ShopfloorMeterItem"""
                  pass
          
          
          Severity: Major
          Found in myems-api/core/shopfloor.py and 50 other locations - About 3 days to fix
          myems-api/core/combinedequipment.py on lines 713..771
          myems-api/core/combinedequipment.py on lines 1638..1696
          myems-api/core/combinedequipment.py on lines 1838..1896
          myems-api/core/combinedequipment.py on lines 2037..2095
          myems-api/core/combinedequipment.py on lines 2213..2271
          myems-api/core/distributioncircuit.py on lines 527..585
          myems-api/core/energystoragepowerstation.py on lines 705..763
          myems-api/core/equipment.py on lines 1458..1515
          myems-api/core/equipment.py on lines 1655..1713
          myems-api/core/equipment.py on lines 1853..1911
          myems-api/core/equipment.py on lines 2031..2088
          myems-api/core/meter.py on lines 1257..1314
          myems-api/core/microgrid.py on lines 4892..4950
          myems-api/core/sensor.py on lines 417..474
          myems-api/core/shopfloor.py on lines 573..631
          myems-api/core/shopfloor.py on lines 950..1008
          myems-api/core/shopfloor.py on lines 1138..1196
          myems-api/core/shopfloor.py on lines 1314..1371
          myems-api/core/shopfloor.py on lines 1502..1560
          myems-api/core/shopfloor.py on lines 1678..1736
          myems-api/core/shopfloor.py on lines 1854..1911
          myems-api/core/space.py on lines 932..990
          myems-api/core/space.py on lines 1108..1166
          myems-api/core/space.py on lines 1284..1341
          myems-api/core/space.py on lines 1649..1707
          myems-api/core/space.py on lines 1838..1896
          myems-api/core/space.py on lines 2026..2084
          myems-api/core/space.py on lines 2202..2259
          myems-api/core/space.py on lines 2377..2434
          myems-api/core/space.py on lines 2552..2609
          myems-api/core/space.py on lines 2727..2784
          myems-api/core/space.py on lines 2915..2973
          myems-api/core/space.py on lines 3276..3334
          myems-api/core/space.py on lines 3452..3509
          myems-api/core/space.py on lines 5282..5340
          myems-api/core/store.py on lines 705..762
          myems-api/core/store.py on lines 893..951
          myems-api/core/store.py on lines 1081..1139
          myems-api/core/store.py on lines 1257..1314
          myems-api/core/store.py on lines 1445..1503
          myems-api/core/store.py on lines 1621..1679
          myems-api/core/store.py on lines 1797..1854
          myems-api/core/tenant.py on lines 805..862
          myems-api/core/tenant.py on lines 995..1053
          myems-api/core/tenant.py on lines 1185..1243
          myems-api/core/tenant.py on lines 1363..1420
          myems-api/core/tenant.py on lines 1553..1611
          myems-api/core/tenant.py on lines 1731..1789
          myems-api/core/tenant.py on lines 1909..1966
          myems-api/core/virtualpowerplant.py on lines 550..608

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

          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

                      meta_result = {"id": row[0],
                                     "name": row[1],
                                     "uuid": row[2],
                                     "area": row[3],
                                     "is_input_counted": bool(row[4]),
          Severity: Major
          Found in myems-api/core/shopfloor.py and 1 other location - About 6 hrs to fix
          myems-api/core/shopfloor.py on lines 1973..1988

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

          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

                      meta_result = {"id": row[0],
                                     "name": row[1],
                                     "uuid": row[2],
                                     "area": row[3],
                                     "is_input_counted": bool(row[4]),
          Severity: Major
          Found in myems-api/core/shopfloor.py and 1 other location - About 6 hrs to fix
          myems-api/core/shopfloor.py on lines 2534..2549

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

          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

                          meta_result = {"id": row[0],
                                         "name": row[1],
                                         "uuid": row[2],
                                         "area": row[3],
                                         "is_input_counted": bool(row[4]),
          Severity: Major
          Found in myems-api/core/shopfloor.py and 1 other location - About 6 hrs to fix
          myems-api/core/shopfloor.py on lines 251..263

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

          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

                  if row is None:
                      raise falcon.HTTPError(status=falcon.HTTP_404, title='API.NOT_FOUND',
                                             description='API.SHOPFLOOR_NOT_FOUND')
                  else:
                      meta_result = {"id": row[0],
          Severity: Major
          Found in myems-api/core/shopfloor.py and 1 other location - About 6 hrs to fix
          myems-api/core/shopfloor.py on lines 65..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 103.

          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 15 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)}
                              meter_result.append(result)
          Severity: Major
          Found in myems-api/core/shopfloor.py and 14 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2071..2076
          myems-api/core/shopfloor.py on lines 2097..2102
          myems-api/core/shopfloor.py on lines 2597..2602
          myems-api/core/shopfloor.py on lines 2632..2637
          myems-api/core/shopfloor.py on lines 2658..2663
          myems-api/core/space.py on lines 3762..3767
          myems-api/core/space.py on lines 3788..3793
          myems-api/core/space.py on lines 3814..3819
          myems-api/core/space.py on lines 4674..4679
          myems-api/core/space.py on lines 4700..4705
          myems-api/core/space.py on lines 4726..4731
          myems-api/core/store.py on lines 1984..1989
          myems-api/core/store.py on lines 2010..2015
          myems-api/core/store.py on lines 2035..2040

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

          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 15 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)}
                              offlinemeter_result.append(result)
          Severity: Major
          Found in myems-api/core/shopfloor.py and 14 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2036..2041
          myems-api/core/shopfloor.py on lines 2097..2102
          myems-api/core/shopfloor.py on lines 2597..2602
          myems-api/core/shopfloor.py on lines 2632..2637
          myems-api/core/shopfloor.py on lines 2658..2663
          myems-api/core/space.py on lines 3762..3767
          myems-api/core/space.py on lines 3788..3793
          myems-api/core/space.py on lines 3814..3819
          myems-api/core/space.py on lines 4674..4679
          myems-api/core/space.py on lines 4700..4705
          myems-api/core/space.py on lines 4726..4731
          myems-api/core/store.py on lines 1984..1989
          myems-api/core/store.py on lines 2010..2015
          myems-api/core/store.py on lines 2035..2040

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

          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 15 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)}
                              offlinemeter_result.append(result)
          Severity: Major
          Found in myems-api/core/shopfloor.py and 14 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2036..2041
          myems-api/core/shopfloor.py on lines 2071..2076
          myems-api/core/shopfloor.py on lines 2097..2102
          myems-api/core/shopfloor.py on lines 2597..2602
          myems-api/core/shopfloor.py on lines 2658..2663
          myems-api/core/space.py on lines 3762..3767
          myems-api/core/space.py on lines 3788..3793
          myems-api/core/space.py on lines 3814..3819
          myems-api/core/space.py on lines 4674..4679
          myems-api/core/space.py on lines 4700..4705
          myems-api/core/space.py on lines 4726..4731
          myems-api/core/store.py on lines 1984..1989
          myems-api/core/store.py on lines 2010..2015
          myems-api/core/store.py on lines 2035..2040

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

          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 15 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)}
                              virtualmeter_result.append(result)
          Severity: Major
          Found in myems-api/core/shopfloor.py and 14 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2036..2041
          myems-api/core/shopfloor.py on lines 2071..2076
          myems-api/core/shopfloor.py on lines 2097..2102
          myems-api/core/shopfloor.py on lines 2597..2602
          myems-api/core/shopfloor.py on lines 2632..2637
          myems-api/core/space.py on lines 3762..3767
          myems-api/core/space.py on lines 3788..3793
          myems-api/core/space.py on lines 3814..3819
          myems-api/core/space.py on lines 4674..4679
          myems-api/core/space.py on lines 4700..4705
          myems-api/core/space.py on lines 4726..4731
          myems-api/core/store.py on lines 1984..1989
          myems-api/core/store.py on lines 2010..2015
          myems-api/core/store.py on lines 2035..2040

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

          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 15 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)}
                              virtualmeter_result.append(result)
          Severity: Major
          Found in myems-api/core/shopfloor.py and 14 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2036..2041
          myems-api/core/shopfloor.py on lines 2071..2076
          myems-api/core/shopfloor.py on lines 2597..2602
          myems-api/core/shopfloor.py on lines 2632..2637
          myems-api/core/shopfloor.py on lines 2658..2663
          myems-api/core/space.py on lines 3762..3767
          myems-api/core/space.py on lines 3788..3793
          myems-api/core/space.py on lines 3814..3819
          myems-api/core/space.py on lines 4674..4679
          myems-api/core/space.py on lines 4700..4705
          myems-api/core/space.py on lines 4726..4731
          myems-api/core/store.py on lines 1984..1989
          myems-api/core/store.py on lines 2010..2015
          myems-api/core/store.py on lines 2035..2040

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

          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 15 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)}
                              meter_result.append(result)
          Severity: Major
          Found in myems-api/core/shopfloor.py and 14 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2036..2041
          myems-api/core/shopfloor.py on lines 2071..2076
          myems-api/core/shopfloor.py on lines 2097..2102
          myems-api/core/shopfloor.py on lines 2632..2637
          myems-api/core/shopfloor.py on lines 2658..2663
          myems-api/core/space.py on lines 3762..3767
          myems-api/core/space.py on lines 3788..3793
          myems-api/core/space.py on lines 3814..3819
          myems-api/core/space.py on lines 4674..4679
          myems-api/core/space.py on lines 4700..4705
          myems-api/core/space.py on lines 4726..4731
          myems-api/core/store.py on lines 1984..1989
          myems-api/core/store.py on lines 2010..2015
          myems-api/core/store.py on lines 2035..2040

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

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

                      if rows is not None and len(rows) > 0:
                          for row in rows:
                              result = {"id": row[0], "name": row[1], "data_source": data_source_dict.get(row[2], None)}
                              point_result.append(result)
                          meta_result['points'] = point_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 5 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2123..2127
          myems-api/core/space.py on lines 3879..3883
          myems-api/core/space.py on lines 4791..4795
          myems-api/core/store.py on lines 2061..2065
          myems-api/core/store.py on lines 2599..2603

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

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

                      if rows is not None and len(rows) > 0:
                          for row in rows:
                              result = {"id": row[0], "name": row[1], "data_source": data_source_dict.get(row[2], None)}
                              point_result.append(result)
                          meta_result['points'] = point_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 5 other locations - About 5 hrs to fix
          myems-api/core/shopfloor.py on lines 2684..2688
          myems-api/core/space.py on lines 3879..3883
          myems-api/core/space.py on lines 4791..4795
          myems-api/core/store.py on lines 2061..2065
          myems-api/core/store.py on lines 2599..2603

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

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

                  if 'cost_center_id' in new_values['data'].keys():
                      if new_values['data']['cost_center_id'] <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_COST_CENTER_ID')
                      cost_center_id = new_values['data']['cost_center_id']
          Severity: Major
          Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
          myems-api/core/emailmessage.py on lines 116..122
          myems-api/core/emailmessage.py on lines 316..322
          myems-api/core/shopfloor.py on lines 115..121
          myems-api/core/shopfloor.py on lines 371..377
          myems-api/core/shopfloor.py on lines 379..385
          myems-api/core/shopfloor.py on lines 2204..2210
          myems-api/core/shopfloor.py on lines 2212..2218
          myems-api/core/space.py on lines 131..137
          myems-api/core/space.py on lines 166..172
          myems-api/core/space.py on lines 174..180
          myems-api/core/space.py on lines 547..553
          myems-api/core/space.py on lines 3970..3976
          myems-api/core/space.py on lines 4005..4011
          myems-api/core/space.py on lines 4013..4019
          myems-api/core/textmessage.py on lines 106..112
          myems-api/core/textmessage.py on lines 291..297
          myems-api/core/wechatmessage.py on lines 110..116
          myems-api/core/wechatmessage.py on lines 318..324

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

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

                  if 'contact_id' in new_values['data'].keys():
                      if new_values['data']['contact_id'] <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_CONTACT_ID')
                      contact_id = new_values['data']['contact_id']
          Severity: Major
          Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
          myems-api/core/emailmessage.py on lines 116..122
          myems-api/core/emailmessage.py on lines 316..322
          myems-api/core/shopfloor.py on lines 115..121
          myems-api/core/shopfloor.py on lines 123..129
          myems-api/core/shopfloor.py on lines 379..385
          myems-api/core/shopfloor.py on lines 2204..2210
          myems-api/core/shopfloor.py on lines 2212..2218
          myems-api/core/space.py on lines 131..137
          myems-api/core/space.py on lines 166..172
          myems-api/core/space.py on lines 174..180
          myems-api/core/space.py on lines 547..553
          myems-api/core/space.py on lines 3970..3976
          myems-api/core/space.py on lines 4005..4011
          myems-api/core/space.py on lines 4013..4019
          myems-api/core/textmessage.py on lines 106..112
          myems-api/core/textmessage.py on lines 291..297
          myems-api/core/wechatmessage.py on lines 110..116
          myems-api/core/wechatmessage.py on lines 318..324

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

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

                  if 'cost_center_id' in new_values['data'].keys():
                      if new_values['data']['cost_center_id'] <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_COST_CENTER_ID')
                      cost_center_id = new_values['data']['cost_center_id']
          Severity: Major
          Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
          myems-api/core/emailmessage.py on lines 116..122
          myems-api/core/emailmessage.py on lines 316..322
          myems-api/core/shopfloor.py on lines 115..121
          myems-api/core/shopfloor.py on lines 123..129
          myems-api/core/shopfloor.py on lines 371..377
          myems-api/core/shopfloor.py on lines 2204..2210
          myems-api/core/shopfloor.py on lines 2212..2218
          myems-api/core/space.py on lines 131..137
          myems-api/core/space.py on lines 166..172
          myems-api/core/space.py on lines 174..180
          myems-api/core/space.py on lines 547..553
          myems-api/core/space.py on lines 3970..3976
          myems-api/core/space.py on lines 4005..4011
          myems-api/core/space.py on lines 4013..4019
          myems-api/core/textmessage.py on lines 106..112
          myems-api/core/textmessage.py on lines 291..297
          myems-api/core/wechatmessage.py on lines 110..116
          myems-api/core/wechatmessage.py on lines 318..324

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

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

                  if 'contact_id' in new_values['data'].keys():
                      if new_values['data']['contact_id'] <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_CONTACT_ID')
                      contact_id = new_values['data']['contact_id']
          Severity: Major
          Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
          myems-api/core/emailmessage.py on lines 116..122
          myems-api/core/emailmessage.py on lines 316..322
          myems-api/core/shopfloor.py on lines 123..129
          myems-api/core/shopfloor.py on lines 371..377
          myems-api/core/shopfloor.py on lines 379..385
          myems-api/core/shopfloor.py on lines 2204..2210
          myems-api/core/shopfloor.py on lines 2212..2218
          myems-api/core/space.py on lines 131..137
          myems-api/core/space.py on lines 166..172
          myems-api/core/space.py on lines 174..180
          myems-api/core/space.py on lines 547..553
          myems-api/core/space.py on lines 3970..3976
          myems-api/core/space.py on lines 4005..4011
          myems-api/core/space.py on lines 4013..4019
          myems-api/core/textmessage.py on lines 106..112
          myems-api/core/textmessage.py on lines 291..297
          myems-api/core/wechatmessage.py on lines 110..116
          myems-api/core/wechatmessage.py on lines 318..324

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

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

                  if 'id' in new_values['contact'].keys():
                      if new_values['contact']['id'] <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_CONTACT_ID')
                      contact_id = new_values['contact']['id']
          Severity: Major
          Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
          myems-api/core/emailmessage.py on lines 116..122
          myems-api/core/emailmessage.py on lines 316..322
          myems-api/core/shopfloor.py on lines 115..121
          myems-api/core/shopfloor.py on lines 123..129
          myems-api/core/shopfloor.py on lines 371..377
          myems-api/core/shopfloor.py on lines 379..385
          myems-api/core/shopfloor.py on lines 2212..2218
          myems-api/core/space.py on lines 131..137
          myems-api/core/space.py on lines 166..172
          myems-api/core/space.py on lines 174..180
          myems-api/core/space.py on lines 547..553
          myems-api/core/space.py on lines 3970..3976
          myems-api/core/space.py on lines 4005..4011
          myems-api/core/space.py on lines 4013..4019
          myems-api/core/textmessage.py on lines 106..112
          myems-api/core/textmessage.py on lines 291..297
          myems-api/core/wechatmessage.py on lines 110..116
          myems-api/core/wechatmessage.py on lines 318..324

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

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

                  if 'id' in new_values['cost_center'].keys():
                      if new_values['cost_center']['id'] <= 0:
                          raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                 description='API.INVALID_COST_CENTER_ID')
                      cost_center_id = new_values['cost_center']['id']
          Severity: Major
          Found in myems-api/core/shopfloor.py and 18 other locations - About 4 hrs to fix
          myems-api/core/emailmessage.py on lines 116..122
          myems-api/core/emailmessage.py on lines 316..322
          myems-api/core/shopfloor.py on lines 115..121
          myems-api/core/shopfloor.py on lines 123..129
          myems-api/core/shopfloor.py on lines 371..377
          myems-api/core/shopfloor.py on lines 379..385
          myems-api/core/shopfloor.py on lines 2204..2210
          myems-api/core/space.py on lines 131..137
          myems-api/core/space.py on lines 166..172
          myems-api/core/space.py on lines 174..180
          myems-api/core/space.py on lines 547..553
          myems-api/core/space.py on lines 3970..3976
          myems-api/core/space.py on lines 4005..4011
          myems-api/core/space.py on lines 4013..4019
          myems-api/core/textmessage.py on lines 106..112
          myems-api/core/textmessage.py on lines 291..297
          myems-api/core/wechatmessage.py on lines 110..116
          myems-api/core/wechatmessage.py on lines 318..324

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

          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 46 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]}
                              command_result.append(result)
                          meta_result['commands'] = command_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

          Similar blocks of code found in 46 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]}
                              sensor_result.append(result)
                          meta_result['sensors'] = sensor_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

          Similar blocks of code found in 46 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]}
                              sensor_result.append(result)
                          meta_result['sensors'] = sensor_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

          Similar blocks of code found in 46 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]}
                              equipment_result.append(result)
                          meta_result['equipments'] = equipment_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

          Similar blocks of code found in 46 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]}
                              equipment_result.append(result)
                          meta_result['equipments'] = equipment_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

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

                      if rows is not None and len(rows) > 0:
                          for row in rows:
                              result = {"id": row[0], "name": row[1], "description": row[2]}
                              workingcalendar_result.append(result)
                          meta_result['working_calendars'] = workingcalendar_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

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

                      if rows is not None and len(rows) > 0:
                          for row in rows:
                              result = {"id": row[0], "name": row[1], "description": row[2]}
                              workingcalendar_result.append(result)
                          meta_result['working_calendars'] = workingcalendar_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2011..2015
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

          Similar blocks of code found in 46 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]}
                              command_result.append(result)
                          meta_result['commands'] = command_result
          Severity: Major
          Found in myems-api/core/shopfloor.py and 45 other locations - About 4 hrs to fix
          myems-api/core/combinedequipment.py on lines 2357..2361
          myems-api/core/combinedequipment.py on lines 2371..2375
          myems-api/core/combinedequipment.py on lines 3030..3034
          myems-api/core/combinedequipment.py on lines 3044..3048
          myems-api/core/distributionsystem.py on lines 643..647
          myems-api/core/equipment.py on lines 2174..2180
          myems-api/core/equipment.py on lines 2776..2782
          myems-api/core/shopfloor.py on lines 1998..2002
          myems-api/core/shopfloor.py on lines 2136..2140
          myems-api/core/shopfloor.py on lines 2149..2153
          myems-api/core/shopfloor.py on lines 2559..2563
          myems-api/core/shopfloor.py on lines 2572..2576
          myems-api/core/shopfloor.py on lines 2697..2701
          myems-api/core/shopfloor.py on lines 2710..2714
          myems-api/core/space.py on lines 3737..3741
          myems-api/core/space.py on lines 3828..3832
          myems-api/core/space.py on lines 3841..3845
          myems-api/core/space.py on lines 3854..3858
          myems-api/core/space.py on lines 3892..3896
          myems-api/core/space.py on lines 3905..3909
          myems-api/core/space.py on lines 3918..3922
          myems-api/core/space.py on lines 3931..3935
          myems-api/core/space.py on lines 4649..4653
          myems-api/core/space.py on lines 4740..4744
          myems-api/core/space.py on lines 4753..4757
          myems-api/core/space.py on lines 4766..4770
          myems-api/core/space.py on lines 4804..4808
          myems-api/core/space.py on lines 4817..4821
          myems-api/core/space.py on lines 4830..4834
          myems-api/core/space.py on lines 4843..4847
          myems-api/core/store.py on lines 1958..1962
          myems-api/core/store.py on lines 2074..2078
          myems-api/core/store.py on lines 2087..2091
          myems-api/core/store.py on lines 2534..2538
          myems-api/core/store.py on lines 2548..2552
          myems-api/core/store.py on lines 2561..2565
          myems-api/core/store.py on lines 2574..2578
          myems-api/core/store.py on lines 2612..2616
          myems-api/core/store.py on lines 2625..2629
          myems-api/core/tenant.py on lines 2082..2086
          myems-api/core/tenant.py on lines 2202..2206
          myems-api/core/tenant.py on lines 2215..2219
          myems-api/core/tenant.py on lines 2710..2714
          myems-api/core/tenant.py on lines 2830..2834
          myems-api/core/tenant.py on lines 2843..2847

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 82.

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

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

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

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

          Refactorings

          Further Reading

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

                  if 'is_input_counted' not in new_values.keys() or \
                          not isinstance(new_values['is_input_counted'], bool):
                      raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
          Severity: Major
          Found in myems-api/core/shopfloor.py and 19 other locations - About 2 hrs to fix
          myems-api/core/advancedreport.py on lines 516..518
          myems-api/core/advancedreport.py on lines 540..542
          myems-api/core/combinedequipment.py on lines 2597..2599
          myems-api/core/combinedequipment.py on lines 2603..2605
          myems-api/core/equipment.py on lines 2380..2382
          myems-api/core/equipment.py on lines 2386..2388
          myems-api/core/meter.py on lines 1475..1477
          myems-api/core/offlinemeter.py on lines 765..767
          myems-api/core/point.py on lines 1096..1098
          myems-api/core/point.py on lines 1102..1104
          myems-api/core/rule.py on lines 637..639
          myems-api/core/rule.py on lines 643..645
          myems-api/core/space.py on lines 3993..3995
          myems-api/core/space.py on lines 3999..4001
          myems-api/core/store.py on lines 2168..2170
          myems-api/core/tenant.py on lines 2292..2294
          myems-api/core/tenant.py on lines 2298..2300
          myems-api/core/tenant.py on lines 2311..2313
          myems-api/core/virtualmeter.py on lines 1048..1049

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

          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