myems-api/core/space.py

Summary

Maintainability
F
8 mos
Test Coverage

File space.py has 4283 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/space.py - About 1 wk to fix

    Function on_post has a Cognitive Complexity of 325 (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/space.py - About 6 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 170 (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/space.py - About 3 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 149 (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/space.py - About 3 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_put has a Cognitive Complexity of 55 (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/space.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_post has a Cognitive Complexity of 46 (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/space.py - About 7 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 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def on_get(req, resp):
            access_control(req)
            if 'USER-UUID' not in req.headers or \
                    not isinstance(req.headers['USER-UUID'], str) or \
                    len(str.strip(req.headers['USER-UUID'])) == 0:
    Severity: Minor
    Found in myems-api/core/space.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 25 (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/space.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 23 (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/space.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 22 (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/space.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 16 (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/space.py - About 2 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 51 lines of code (exceeds 25 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: Major
    Found in myems-api/core/space.py - About 2 hrs to fix

      Function on_post has 47 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/space.py - About 1 hr to fix

        Function on_put has 38 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/space.py - About 1 hr to fix

          Function on_post has 36 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/space.py - About 1 hr to fix

            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/space.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/space.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/space.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/space.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 31 lines of code (exceeds 25 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/space.py - About 1 hr to fix

              Function on_get has 31 lines of code (exceeds 25 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/space.py - About 1 hr to fix

                Function on_get has 30 lines of code (exceeds 25 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/space.py - About 1 hr to fix

                  Function on_post has 28 lines of code (exceeds 25 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/space.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/space.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 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/space.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/space.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/space.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/space.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

                    Avoid deeply nested control flow statements.
                    Open

                                            if cursor.fetchone() is not None:
                                                cursor.close()
                                                cnx.close()
                                                raise falcon.HTTPError(status=falcon.HTTP_400, title='API.ERROR',
                                                                       description='API.SPACE_WORKING_CALENDAR_RELATION_EXISTS')
                    Severity: Major
                    Found in myems-api/core/space.py - About 45 mins to fix

                      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/space.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/space.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/space.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/space.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

                      Avoid deeply nested control flow statements.
                      Open

                                              if cursor.fetchone() is None:
                                                  cursor.close()
                                                  cnx.close()
                                                  raise falcon.HTTPError(status=falcon.HTTP_404, title='API.NOT_FOUND',
                                                                         description='API.WORKING_CALENDAR_NOT_FOUND')
                      Severity: Major
                      Found in myems-api/core/space.py - About 45 mins to fix

                        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/space.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/space.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/space.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/space.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/space.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/space.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/space.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/space.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/space.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/space.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/space.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/space.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/space.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_, 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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_, 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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_, 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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_):
                                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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_, tid):
                                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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_, tid):
                                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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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_SPACE_ID')
                        Severity: Minor
                        Found in myems-api/core/space.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 SpaceMeterCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 11 other locations - About 1 wk to fix
                        myems-api/core/shopfloor.py on lines 638..764
                        myems-api/core/shopfloor.py on lines 828..954
                        myems-api/core/shopfloor.py on lines 1386..1512
                        myems-api/core/space.py on lines 1545..1671
                        myems-api/core/space.py on lines 2634..2760
                        myems-api/core/store.py on lines 579..705
                        myems-api/core/store.py on lines 769..895
                        myems-api/core/store.py on lines 1327..1453
                        myems-api/core/tenant.py on lines 672..800
                        myems-api/core/tenant.py on lines 864..992
                        myems-api/core/tenant.py on lines 1428..1556

                        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 SpaceVirtualMeterCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 11 other locations - About 1 wk to fix
                        myems-api/core/shopfloor.py on lines 638..764
                        myems-api/core/shopfloor.py on lines 828..954
                        myems-api/core/shopfloor.py on lines 1386..1512
                        myems-api/core/space.py on lines 1353..1479
                        myems-api/core/space.py on lines 1545..1671
                        myems-api/core/store.py on lines 579..705
                        myems-api/core/store.py on lines 769..895
                        myems-api/core/store.py on lines 1327..1453
                        myems-api/core/tenant.py on lines 672..800
                        myems-api/core/tenant.py on lines 864..992
                        myems-api/core/tenant.py on lines 1428..1556

                        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 SpaceOfflineMeterCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 11 other locations - About 1 wk to fix
                        myems-api/core/shopfloor.py on lines 638..764
                        myems-api/core/shopfloor.py on lines 828..954
                        myems-api/core/shopfloor.py on lines 1386..1512
                        myems-api/core/space.py on lines 1353..1479
                        myems-api/core/space.py on lines 2634..2760
                        myems-api/core/store.py on lines 579..705
                        myems-api/core/store.py on lines 769..895
                        myems-api/core/store.py on lines 1327..1453
                        myems-api/core/tenant.py on lines 672..800
                        myems-api/core/tenant.py on lines 864..992
                        myems-api/core/tenant.py on lines 1428..1556

                        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 SpacePointCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 3 other locations - About 1 wk to fix
                        myems-api/core/shopfloor.py on lines 1019..1144
                        myems-api/core/store.py on lines 960..1085
                        myems-api/core/tenant.py on lines 1057..1184

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

                        class SpaceSensorCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceCommandCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceTenantCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceShopfloorCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceWorkingCalendarCollection:
                            @staticmethod
                            def __init__():
                                """Initializes SpaceWorkingCalendarCollection Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceEquipmentCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceStoreCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceCombinedEquipmentCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 998..1111
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                        class SpaceEnergyStoragePowerStationCollection:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 22 other locations - About 1 wk to fix
                        myems-api/core/combinedequipment.py on lines 2065..2178
                        myems-api/core/equipment.py on lines 1876..1991
                        myems-api/core/meter.py on lines 1147..1260
                        myems-api/core/shopfloor.py on lines 460..573
                        myems-api/core/shopfloor.py on lines 1209..1322
                        myems-api/core/shopfloor.py on lines 1577..1690
                        myems-api/core/shopfloor.py on lines 1755..1868
                        myems-api/core/space.py on lines 820..933
                        myems-api/core/space.py on lines 1176..1289
                        myems-api/core/space.py on lines 1926..2039
                        myems-api/core/space.py on lines 2103..2216
                        myems-api/core/space.py on lines 2280..2393
                        myems-api/core/space.py on lines 2457..2570
                        myems-api/core/space.py on lines 3012..3125
                        myems-api/core/space.py on lines 3190..3303
                        myems-api/core/store.py on lines 1150..1263
                        myems-api/core/store.py on lines 1518..1631
                        myems-api/core/store.py on lines 1696..1809
                        myems-api/core/tenant.py on lines 1249..1364
                        myems-api/core/tenant.py on lines 1621..1736
                        myems-api/core/tenant.py on lines 1801..1916
                        myems-api/core/virtualpowerplant.py on lines 393..506

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

                                    if meta_result['stores'] is not None and len(meta_result['stores']) > 0:
                                        for store in meta_result['stores']:
                                            cursor.execute(" SELECT name "
                                                           " FROM tbl_stores "
                                                           " WHERE id = %s ", (store['id'],))
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 4 days to fix
                        myems-api/core/space.py on lines 4221..4268

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if new_values['stores'] is not None and len(new_values['stores']) > 0:
                                    for store in new_values['stores']:
                                        cursor.execute(" SELECT name "
                                                       " FROM tbl_stores "
                                                       " WHERE id = %s ", (store['id'],))
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 4 days to fix
                        myems-api/core/space.py on lines 4969..5016

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

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

                        class SpaceEquipmentItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceTenantItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceEnergyStoragePowerStationItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceSensorItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpacePointItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceVirtualMeterItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceWorkingCalendarItem:
                            @staticmethod
                            def __init__():
                                """Initializes SpaceWorkingCalendarItem Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceCombinedEquipmentItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceOfflineMeterItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceShopfloorItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceStoreItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/space.py on lines 3306..3364
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

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

                        class SpaceCommandItem:
                            @staticmethod
                            def __init__():
                                """Initializes Class"""
                                pass
                        Severity: Major
                        Found in myems-api/core/space.py and 49 other locations - About 3 days to fix
                        myems-api/core/combinedequipment.py on lines 671..730
                        myems-api/core/combinedequipment.py on lines 1600..1659
                        myems-api/core/combinedequipment.py on lines 1802..1861
                        myems-api/core/combinedequipment.py on lines 2003..2062
                        myems-api/core/combinedequipment.py on lines 2181..2240
                        myems-api/core/distributioncircuit.py on lines 530..589
                        myems-api/core/energystoragecontainer.py on lines 555..614
                        myems-api/core/energystoragepowerstation.py on lines 661..720
                        myems-api/core/equipment.py on lines 1415..1473
                        myems-api/core/equipment.py on lines 1614..1673
                        myems-api/core/equipment.py on lines 1814..1873
                        myems-api/core/equipment.py on lines 1994..2052
                        myems-api/core/meter.py on lines 1263..1321
                        myems-api/core/microgrid.py on lines 5112..5171
                        myems-api/core/sensor.py on lines 420..478
                        myems-api/core/shopfloor.py on lines 576..635
                        myems-api/core/shopfloor.py on lines 767..825
                        myems-api/core/shopfloor.py on lines 957..1016
                        myems-api/core/shopfloor.py on lines 1147..1206
                        myems-api/core/shopfloor.py on lines 1325..1383
                        myems-api/core/shopfloor.py on lines 1515..1574
                        myems-api/core/shopfloor.py on lines 1693..1752
                        myems-api/core/shopfloor.py on lines 1871..1929
                        myems-api/core/space.py on lines 936..995
                        myems-api/core/space.py on lines 1114..1173
                        myems-api/core/space.py on lines 1292..1350
                        myems-api/core/space.py on lines 1674..1733
                        myems-api/core/space.py on lines 1864..1923
                        myems-api/core/space.py on lines 2042..2100
                        myems-api/core/space.py on lines 2219..2277
                        myems-api/core/space.py on lines 2396..2454
                        myems-api/core/space.py on lines 2573..2631
                        myems-api/core/space.py on lines 2763..2822
                        myems-api/core/space.py on lines 3128..3187
                        myems-api/core/store.py on lines 708..766
                        myems-api/core/store.py on lines 898..957
                        myems-api/core/store.py on lines 1088..1147
                        myems-api/core/store.py on lines 1266..1324
                        myems-api/core/store.py on lines 1456..1515
                        myems-api/core/store.py on lines 1634..1693
                        myems-api/core/store.py on lines 1812..1870
                        myems-api/core/tenant.py on lines 803..861
                        myems-api/core/tenant.py on lines 995..1054
                        myems-api/core/tenant.py on lines 1187..1246
                        myems-api/core/tenant.py on lines 1367..1425
                        myems-api/core/tenant.py on lines 1559..1618
                        myems-api/core/tenant.py on lines 1739..1798
                        myems-api/core/tenant.py on lines 1919..1977
                        myems-api/core/virtualpowerplant.py on lines 509..568

                        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

                                    if rows_spaces is not None and len(rows_spaces) > 0:
                                        for row in rows_spaces:
                                            children_result = {"id": row[0],
                                                               "name": row[1],
                                                               "uuid": row[2],
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 3568..3584

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 210.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                    if rows_spaces is not None and len(rows_spaces) > 0:
                                        for row in rows_spaces:
                                            children_result = {"id": row[0],
                                                               "name": row[1],
                                                               "uuid": row[2],
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 4482..4498

                        Duplicated Code

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

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

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

                        Tuning

                        This issue has a mass of 210.

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if 'latitude' in new_values['data'].keys():
                                    if new_values['data']['latitude'] is not None:
                                        if not (isinstance(new_values['data']['latitude'], float) or
                                                isinstance(new_values['data']['latitude'], int)) or \
                                                new_values['data']['latitude'] < -90.0 or \
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 571..583

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if 'longitude' in new_values['data'].keys():
                                    if new_values['data']['latitude'] is not None:
                                        if not (isinstance(new_values['data']['longitude'], float) or
                                                isinstance(new_values['data']['longitude'], int)) or \
                                                new_values['data']['longitude'] < -180.0 or \
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 557..569

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if 'longitude' in new_values['data'].keys() and new_values['data']['longitude'] is not None:
                                    if not (isinstance(new_values['data']['longitude'], float) or
                                            isinstance(new_values['data']['longitude'], int)) or \
                                            new_values['data']['longitude'] < -180.0 or \
                                            new_values['data']['longitude'] > 180.0:
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 183..192

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if 'latitude' in new_values['data'].keys() and new_values['data']['latitude'] is not None:
                                    if not (isinstance(new_values['data']['latitude'], float) or
                                            isinstance(new_values['data']['latitude'], int)) or \
                                            new_values['data']['latitude'] < -90.0 or \
                                            new_values['data']['latitude'] > 90.0:
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 194..203

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

                        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],
                                                   "parent_space_id": space_dict.get(row[3], None),
                                                   "area": row[4],
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 4366..4391

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

                        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],
                                                   "parent_space_id": space_dict.get(row[3], None),
                                                   "area": row[4],
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 3452..3477

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                        meta_result = {"id": row[0],
                                                       "name": row[1],
                                                       "uuid": row[2],
                                                       "parent_space": space_dict.get(row[3], None),
                                                       "area": row[4],
                        Severity: Major
                        Found in myems-api/core/space.py and 2 other locations - About 1 day to fix
                        myems-api/core/space.py on lines 377..394
                        myems-api/core/space.py on lines 799..812

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                        meta_result = {"id": row[0],
                                                       "name": row[1],
                                                       "uuid": row[2],
                                                       "parent_space": space_dict.get(row[3], None),
                                                       "area": row[4],
                        Severity: Major
                        Found in myems-api/core/space.py and 2 other locations - About 1 day to fix
                        myems-api/core/space.py on lines 92..105
                        myems-api/core/space.py on lines 377..394

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if row is None:
                                    raise falcon.HTTPError(status=falcon.HTTP_404, title='API.NOT_FOUND',
                                                           description='API.SPACE_NOT_FOUND')
                                else:
                                    meta_result = {"id": row[0],
                        Severity: Major
                        Found in myems-api/core/space.py and 2 other locations - About 1 day to fix
                        myems-api/core/space.py on lines 92..105
                        myems-api/core/space.py on lines 799..812

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if 'longitude' in new_values.keys() and new_values['longitude'] is not None:
                                    if not (isinstance(new_values['longitude'], float) or
                                            isinstance(new_values['longitude'], int)) or \
                                            new_values['longitude'] < -180.0 or \
                                            new_values['longitude'] > 180.0:
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 3878..3887

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if 'latitude' in new_values.keys() and new_values['latitude'] is not None:
                                    if not (isinstance(new_values['latitude'], float) or
                                            isinstance(new_values['latitude'], int)) or \
                                            new_values['latitude'] < -90.0 or \
                                            new_values['latitude'] > 90.0:
                        Severity: Major
                        Found in myems-api/core/space.py and 1 other location - About 1 day to fix
                        myems-api/core/space.py on lines 3889..3898

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

                        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/space.py and 14 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2055..2060
                        myems-api/core/shopfloor.py on lines 2090..2095
                        myems-api/core/shopfloor.py on lines 2116..2121
                        myems-api/core/shopfloor.py on lines 2618..2623
                        myems-api/core/shopfloor.py on lines 2653..2658
                        myems-api/core/shopfloor.py on lines 2679..2684
                        myems-api/core/space.py on lines 3618..3623
                        myems-api/core/space.py on lines 3644..3649
                        myems-api/core/space.py on lines 3670..3675
                        myems-api/core/space.py on lines 4532..4537
                        myems-api/core/space.py on lines 4558..4563
                        myems-api/core/store.py on lines 2001..2006
                        myems-api/core/store.py on lines 2027..2032
                        myems-api/core/store.py on lines 2052..2057

                        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/space.py and 14 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2055..2060
                        myems-api/core/shopfloor.py on lines 2090..2095
                        myems-api/core/shopfloor.py on lines 2116..2121
                        myems-api/core/shopfloor.py on lines 2618..2623
                        myems-api/core/shopfloor.py on lines 2653..2658
                        myems-api/core/shopfloor.py on lines 2679..2684
                        myems-api/core/space.py on lines 3618..3623
                        myems-api/core/space.py on lines 3644..3649
                        myems-api/core/space.py on lines 3670..3675
                        myems-api/core/space.py on lines 4532..4537
                        myems-api/core/space.py on lines 4584..4589
                        myems-api/core/store.py on lines 2001..2006
                        myems-api/core/store.py on lines 2027..2032
                        myems-api/core/store.py on lines 2052..2057

                        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/space.py and 14 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2055..2060
                        myems-api/core/shopfloor.py on lines 2090..2095
                        myems-api/core/shopfloor.py on lines 2116..2121
                        myems-api/core/shopfloor.py on lines 2618..2623
                        myems-api/core/shopfloor.py on lines 2653..2658
                        myems-api/core/shopfloor.py on lines 2679..2684
                        myems-api/core/space.py on lines 3618..3623
                        myems-api/core/space.py on lines 3644..3649
                        myems-api/core/space.py on lines 3670..3675
                        myems-api/core/space.py on lines 4558..4563
                        myems-api/core/space.py on lines 4584..4589
                        myems-api/core/store.py on lines 2001..2006
                        myems-api/core/store.py on lines 2027..2032
                        myems-api/core/store.py on lines 2052..2057

                        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/space.py and 14 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2055..2060
                        myems-api/core/shopfloor.py on lines 2090..2095
                        myems-api/core/shopfloor.py on lines 2116..2121
                        myems-api/core/shopfloor.py on lines 2618..2623
                        myems-api/core/shopfloor.py on lines 2653..2658
                        myems-api/core/shopfloor.py on lines 2679..2684
                        myems-api/core/space.py on lines 3618..3623
                        myems-api/core/space.py on lines 3670..3675
                        myems-api/core/space.py on lines 4532..4537
                        myems-api/core/space.py on lines 4558..4563
                        myems-api/core/space.py on lines 4584..4589
                        myems-api/core/store.py on lines 2001..2006
                        myems-api/core/store.py on lines 2027..2032
                        myems-api/core/store.py on lines 2052..2057

                        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/space.py and 14 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2055..2060
                        myems-api/core/shopfloor.py on lines 2090..2095
                        myems-api/core/shopfloor.py on lines 2116..2121
                        myems-api/core/shopfloor.py on lines 2618..2623
                        myems-api/core/shopfloor.py on lines 2653..2658
                        myems-api/core/shopfloor.py on lines 2679..2684
                        myems-api/core/space.py on lines 3644..3649
                        myems-api/core/space.py on lines 3670..3675
                        myems-api/core/space.py on lines 4532..4537
                        myems-api/core/space.py on lines 4558..4563
                        myems-api/core/space.py on lines 4584..4589
                        myems-api/core/store.py on lines 2001..2006
                        myems-api/core/store.py on lines 2027..2032
                        myems-api/core/store.py on lines 2052..2057

                        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/space.py and 14 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2055..2060
                        myems-api/core/shopfloor.py on lines 2090..2095
                        myems-api/core/shopfloor.py on lines 2116..2121
                        myems-api/core/shopfloor.py on lines 2618..2623
                        myems-api/core/shopfloor.py on lines 2653..2658
                        myems-api/core/shopfloor.py on lines 2679..2684
                        myems-api/core/space.py on lines 3618..3623
                        myems-api/core/space.py on lines 3644..3649
                        myems-api/core/space.py on lines 4532..4537
                        myems-api/core/space.py on lines 4558..4563
                        myems-api/core/space.py on lines 4584..4589
                        myems-api/core/store.py on lines 2001..2006
                        myems-api/core/store.py on lines 2027..2032
                        myems-api/core/store.py on lines 2052..2057

                        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/space.py and 5 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2142..2146
                        myems-api/core/shopfloor.py on lines 2705..2709
                        myems-api/core/space.py on lines 4649..4653
                        myems-api/core/store.py on lines 2078..2082
                        myems-api/core/store.py on lines 2618..2622

                        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/space.py and 5 other locations - About 5 hrs to fix
                        myems-api/core/shopfloor.py on lines 2142..2146
                        myems-api/core/shopfloor.py on lines 2705..2709
                        myems-api/core/space.py on lines 3735..3739
                        myems-api/core/store.py on lines 2078..2082
                        myems-api/core/store.py on lines 2618..2622

                        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 '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/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 132..138
                        myems-api/core/space.py on lines 167..173
                        myems-api/core/space.py on lines 175..181
                        myems-api/core/space.py on lines 549..555
                        myems-api/core/space.py on lines 3827..3833
                        myems-api/core/space.py on lines 3862..3868
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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 'parent_space_id' in new_values['data'].keys():
                                    if new_values['data']['parent_space_id'] <= 0:
                                        raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                               description='API.INVALID_PARENT_SPACE_ID')
                                    parent_space_id = new_values['data']['parent_space_id']
                        Severity: Major
                        Found in myems-api/core/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 167..173
                        myems-api/core/space.py on lines 175..181
                        myems-api/core/space.py on lines 549..555
                        myems-api/core/space.py on lines 3827..3833
                        myems-api/core/space.py on lines 3862..3868
                        myems-api/core/space.py on lines 3870..3876
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 132..138
                        myems-api/core/space.py on lines 175..181
                        myems-api/core/space.py on lines 549..555
                        myems-api/core/space.py on lines 3827..3833
                        myems-api/core/space.py on lines 3862..3868
                        myems-api/core/space.py on lines 3870..3876
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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['parent_space_id'].keys():
                                    if new_values['parent_space_id']['id'] <= 0:
                                        raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                                                               description='API.INVALID_PARENT_SPACE_ID')
                                    parent_space_id = new_values['parent_space_id']['id']
                        Severity: Major
                        Found in myems-api/core/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 132..138
                        myems-api/core/space.py on lines 167..173
                        myems-api/core/space.py on lines 175..181
                        myems-api/core/space.py on lines 549..555
                        myems-api/core/space.py on lines 3862..3868
                        myems-api/core/space.py on lines 3870..3876
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 132..138
                        myems-api/core/space.py on lines 167..173
                        myems-api/core/space.py on lines 175..181
                        myems-api/core/space.py on lines 549..555
                        myems-api/core/space.py on lines 3827..3833
                        myems-api/core/space.py on lines 3870..3876
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 132..138
                        myems-api/core/space.py on lines 167..173
                        myems-api/core/space.py on lines 549..555
                        myems-api/core/space.py on lines 3827..3833
                        myems-api/core/space.py on lines 3862..3868
                        myems-api/core/space.py on lines 3870..3876
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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/space.py and 18 other locations - About 4 hrs to fix
                        myems-api/core/emailmessage.py on lines 117..123
                        myems-api/core/emailmessage.py on lines 318..324
                        myems-api/core/shopfloor.py on lines 116..122
                        myems-api/core/shopfloor.py on lines 124..130
                        myems-api/core/shopfloor.py on lines 373..379
                        myems-api/core/shopfloor.py on lines 381..387
                        myems-api/core/shopfloor.py on lines 2224..2230
                        myems-api/core/shopfloor.py on lines 2232..2238
                        myems-api/core/space.py on lines 132..138
                        myems-api/core/space.py on lines 167..173
                        myems-api/core/space.py on lines 175..181
                        myems-api/core/space.py on lines 3827..3833
                        myems-api/core/space.py on lines 3862..3868
                        myems-api/core/space.py on lines 3870..3876
                        myems-api/core/textmessage.py on lines 107..113
                        myems-api/core/textmessage.py on lines 293..299
                        myems-api/core/wechatmessage.py on lines 111..117
                        myems-api/core/wechatmessage.py on lines 320..326

                        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]}
                                            equipment_result.append(result)
                                        meta_result['equipments'] = equipment_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            tenant_result.append(result)
                                        meta_result['tenants'] = tenant_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            combinedequipment_result.append(result)
                                        meta_result['combined_equipments'] = combinedequipment_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            shopfloor_result.append(result)
                                        meta_result['shopfloors'] = shopfloor_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            shopfloor_result.append(result)
                                        meta_result['shopfloors'] = shopfloor_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            store_result.append(result)
                                        meta_result['stores'] = store_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            store_result.append(result)
                                        meta_result['stores'] = store_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            combinedequipment_result.append(result)
                                        meta_result['combined_equipments'] = combinedequipment_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4675..4679
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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]}
                                            tenant_result.append(result)
                                        meta_result['tenants'] = tenant_result
                        Severity: Major
                        Found in myems-api/core/space.py and 45 other locations - About 4 hrs to fix
                        myems-api/core/combinedequipment.py on lines 2315..2319
                        myems-api/core/combinedequipment.py on lines 2329..2333
                        myems-api/core/combinedequipment.py on lines 2978..2982
                        myems-api/core/combinedequipment.py on lines 2992..2996
                        myems-api/core/distributionsystem.py on lines 579..583
                        myems-api/core/equipment.py on lines 2127..2133
                        myems-api/core/equipment.py on lines 2719..2725
                        myems-api/core/shopfloor.py on lines 2017..2021
                        myems-api/core/shopfloor.py on lines 2030..2034
                        myems-api/core/shopfloor.py on lines 2155..2159
                        myems-api/core/shopfloor.py on lines 2168..2172
                        myems-api/core/shopfloor.py on lines 2580..2584
                        myems-api/core/shopfloor.py on lines 2593..2597
                        myems-api/core/shopfloor.py on lines 2718..2722
                        myems-api/core/shopfloor.py on lines 2731..2735
                        myems-api/core/space.py on lines 3593..3597
                        myems-api/core/space.py on lines 3684..3688
                        myems-api/core/space.py on lines 3697..3701
                        myems-api/core/space.py on lines 3710..3714
                        myems-api/core/space.py on lines 3748..3752
                        myems-api/core/space.py on lines 3761..3765
                        myems-api/core/space.py on lines 3774..3778
                        myems-api/core/space.py on lines 3787..3791
                        myems-api/core/space.py on lines 4507..4511
                        myems-api/core/space.py on lines 4598..4602
                        myems-api/core/space.py on lines 4611..4615
                        myems-api/core/space.py on lines 4624..4628
                        myems-api/core/space.py on lines 4662..4666
                        myems-api/core/space.py on lines 4688..4692
                        myems-api/core/space.py on lines 4701..4705
                        myems-api/core/store.py on lines 1975..1979
                        myems-api/core/store.py on lines 2091..2095
                        myems-api/core/store.py on lines 2104..2108
                        myems-api/core/store.py on lines 2553..2557
                        myems-api/core/store.py on lines 2567..2571
                        myems-api/core/store.py on lines 2580..2584
                        myems-api/core/store.py on lines 2593..2597
                        myems-api/core/store.py on lines 2631..2635
                        myems-api/core/store.py on lines 2644..2648
                        myems-api/core/tenant.py on lines 2092..2096
                        myems-api/core/tenant.py on lines 2212..2216
                        myems-api/core/tenant.py on lines 2225..2229
                        myems-api/core/tenant.py on lines 2720..2724
                        myems-api/core/tenant.py on lines 2840..2844
                        myems-api/core/tenant.py on lines 2853..2857

                        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

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

                                try:
                                    raw_json = req.stream.read().decode('utf-8')
                                    new_values = json.loads(raw_json)
                                except Exception as ex:
                                    raise falcon.HTTPError(status=falcon.HTTP_400,
                        Severity: Major
                        Found in myems-api/core/space.py and 18 other locations - About 2 hrs to fix
                        myems-api/core/apikey.py on lines 56..60
                        myems-api/core/privilege.py on lines 47..51
                        myems-api/core/privilege.py on lines 151..155
                        myems-api/core/space.py on lines 3812..3816
                        myems-api/core/user.py on lines 71..75
                        myems-api/core/user.py on lines 317..321
                        myems-api/core/user.py on lines 470..474
                        myems-api/core/user.py on lines 710..714
                        myems-api/core/user.py on lines 839..843
                        myems-api/core/user.py on lines 1019..1023
                        myems-api/core/user.py on lines 1204..1208
                        myems-api/core/user.py on lines 1389..1393
                        myems-api/core/user.py on lines 1586..1590
                        myems-api/core/user.py on lines 1802..1806
                        myems-api/core/user.py on lines 1919..1923
                        myems-api/core/workingcalendar.py on lines 51..55
                        myems-api/core/workingcalendar.py on lines 332..336
                        myems-api/core/workingcalendar.py on lines 589..593

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

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

                                try:
                                    raw_json = req.stream.read().decode('utf-8')
                                    new_values = json.loads(raw_json)
                                except Exception as ex:
                                    raise falcon.HTTPError(status=falcon.HTTP_400,
                        Severity: Major
                        Found in myems-api/core/space.py and 18 other locations - About 2 hrs to fix
                        myems-api/core/apikey.py on lines 56..60
                        myems-api/core/privilege.py on lines 47..51
                        myems-api/core/privilege.py on lines 151..155
                        myems-api/core/space.py on lines 117..121
                        myems-api/core/user.py on lines 71..75
                        myems-api/core/user.py on lines 317..321
                        myems-api/core/user.py on lines 470..474
                        myems-api/core/user.py on lines 710..714
                        myems-api/core/user.py on lines 839..843
                        myems-api/core/user.py on lines 1019..1023
                        myems-api/core/user.py on lines 1204..1208
                        myems-api/core/user.py on lines 1389..1393
                        myems-api/core/user.py on lines 1586..1590
                        myems-api/core/user.py on lines 1802..1806
                        myems-api/core/user.py on lines 1919..1923
                        myems-api/core/workingcalendar.py on lines 51..55
                        myems-api/core/workingcalendar.py on lines 332..336
                        myems-api/core/workingcalendar.py on lines 589..593

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

                        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_output_counted' not in new_values.keys() or \
                                        not isinstance(new_values['is_output_counted'], bool):
                                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                        Severity: Major
                        Found in myems-api/core/space.py and 19 other locations - About 2 hrs to fix
                        myems-api/core/advancedreport.py on lines 521..523
                        myems-api/core/advancedreport.py on lines 545..547
                        myems-api/core/combinedequipment.py on lines 2556..2558
                        myems-api/core/combinedequipment.py on lines 2562..2564
                        myems-api/core/equipment.py on lines 2334..2336
                        myems-api/core/equipment.py on lines 2340..2342
                        myems-api/core/meter.py on lines 1484..1486
                        myems-api/core/offlinemeter.py on lines 769..771
                        myems-api/core/point.py on lines 1023..1025
                        myems-api/core/point.py on lines 1029..1031
                        myems-api/core/rule.py on lines 642..644
                        myems-api/core/rule.py on lines 648..650
                        myems-api/core/shopfloor.py on lines 2218..2220
                        myems-api/core/space.py on lines 3850..3852
                        myems-api/core/store.py on lines 2186..2188
                        myems-api/core/tenant.py on lines 2303..2305
                        myems-api/core/tenant.py on lines 2309..2311
                        myems-api/core/tenant.py on lines 2322..2324
                        myems-api/core/virtualmeter.py on lines 1052..1053

                        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

                        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/space.py and 19 other locations - About 2 hrs to fix
                        myems-api/core/advancedreport.py on lines 521..523
                        myems-api/core/advancedreport.py on lines 545..547
                        myems-api/core/combinedequipment.py on lines 2556..2558
                        myems-api/core/combinedequipment.py on lines 2562..2564
                        myems-api/core/equipment.py on lines 2334..2336
                        myems-api/core/equipment.py on lines 2340..2342
                        myems-api/core/meter.py on lines 1484..1486
                        myems-api/core/offlinemeter.py on lines 769..771
                        myems-api/core/point.py on lines 1023..1025
                        myems-api/core/point.py on lines 1029..1031
                        myems-api/core/rule.py on lines 642..644
                        myems-api/core/rule.py on lines 648..650
                        myems-api/core/shopfloor.py on lines 2218..2220
                        myems-api/core/space.py on lines 3856..3858
                        myems-api/core/store.py on lines 2186..2188
                        myems-api/core/tenant.py on lines 2303..2305
                        myems-api/core/tenant.py on lines 2309..2311
                        myems-api/core/tenant.py on lines 2322..2324
                        myems-api/core/virtualmeter.py on lines 1052..1053

                        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

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

                                    new_name = (str.strip(meta_result['name'])
                                                + (datetime.now()
                                                   + timedelta(minutes=timezone_offset)).isoformat(sep='-', timespec='seconds'))
                        Severity: Major
                        Found in myems-api/core/space.py and 26 other locations - About 2 hrs to fix
                        myems-api/core/advancedreport.py on lines 643..645
                        myems-api/core/combinedequipment.py on lines 3185..3187
                        myems-api/core/command.py on lines 672..674
                        myems-api/core/datasource.py on lines 851..852
                        myems-api/core/distributionsystem.py on lines 590..592
                        myems-api/core/energyflowdiagram.py on lines 1696..1698
                        myems-api/core/energystoragepowerstation.py on lines 931..932
                        myems-api/core/energystoragepowerstation.py on lines 1206..1207
                        myems-api/core/equipment.py on lines 2893..2895
                        myems-api/core/gateway.py on lines 499..501
                        myems-api/core/meter.py on lines 1473..1474
                        myems-api/core/meter.py on lines 1756..1757
                        myems-api/core/microgrid.py on lines 5680..5682
                        myems-api/core/offlinemeter.py on lines 974..976
                        myems-api/core/photovoltaicpowerstation.py on lines 800..802
                        myems-api/core/point.py on lines 1160..1162
                        myems-api/core/rule.py on lines 757..759
                        myems-api/core/sensor.py on lines 682..684
                        myems-api/core/shopfloor.py on lines 2739..2741
                        myems-api/core/store.py on lines 2652..2654
                        myems-api/core/tariff.py on lines 727..729
                        myems-api/core/tenant.py on lines 2861..2863
                        myems-api/core/virtualmeter.py on lines 1364..1366
                        myems-api/core/virtualpowerplant.py on lines 823..825
                        myems-api/core/windfarm.py on lines 792..794
                        myems-api/core/workingcalendar.py on lines 722..724

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if int(id_) == 1:
                                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                        Severity: Minor
                        Found in myems-api/core/space.py and 1 other location - About 35 mins to fix
                        myems-api/core/space.py on lines 405..406

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

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

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

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

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

                        Refactorings

                        Further Reading

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

                                if int(id_) == 1:
                                    raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
                        Severity: Minor
                        Found in myems-api/core/space.py and 1 other location - About 35 mins to fix
                        myems-api/core/space.py on lines 4299..4300

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

                        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