Showing 5,781 of 10,536 total issues

Function EasyPieChart has 94 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var EasyPieChart = function(el, opts) {
        var defaultOptions = {
            barColor: '#ef1e25',
            trackColor: '#f9f9f9',
            scaleColor: '#dfe0e0',
Severity: Major
Found in myems-admin/js/plugins/easypiechart/easypiechart.js - About 3 hrs to fix

    Function EasyPieChart has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var EasyPieChart = function(el, opts) {
            var defaultOptions = {
                barColor: '#ef1e25',
                trackColor: '#f9f9f9',
                scaleColor: '#dfe0e0',
    Severity: Major
    Found in myems-admin/js/plugins/easypiechart/angular.easypiechart.js - About 3 hrs to fix

      Function PostCreateForm has 94 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const PostCreateForm = () => {
        const { feedDispatch } = useContext(FeedContext);
        const [privacy, setPrivacy] = useState('public');
        const [status, setStatus] = useState('');
      
      
      Severity: Major
      Found in myems-web/src/components/feed/PostCreateForm.js - About 3 hrs to fix

        Function ModalAttachmentsContent has 94 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ModalAttachmentsContent = () => {
          const [nestedModal, setNestedModal] = useState(false);
          const toggleNested = () => {
            setNestedModal(!nestedModal);
          };
        Severity: Major
        Found in myems-web/src/components/kanban/ModalAttachmentsContent.js - About 3 hrs to fix

          Function on_get has 94 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: Major
          Found in myems-api/reports/equipmentincome.py - About 3 hrs to fix

            Function bindContainerTouchEvents has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

              bindContainerTouchEvents: function(){
                var touchStartScale,
                    touchStartDistance,
                    map = this,
                    touchX,
            Severity: Minor
            Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/equipment_energy_input_item.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/tenant_energy_input_category.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/microgrid_energy_discharge.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 calculate_hourly has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def calculate_hourly(logger):
            
                while True:
                    ################################################################################################################
                    # Step 1: Query all meters and associated energy value points
            Severity: Minor
            Found in myems-normalization/meter.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/combined_equipment_energy_output_category.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 calculate_hourly has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def calculate_hourly(logger):
            
                while True:
                    # the outermost while loop to reconnect server if there is a connection error
                    cnx_system_db = None
            Severity: Minor
            Found in myems-normalization/virtualmeter.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 calculate has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def calculate(logger):
                while True:
                    # the outermost while loop to reconnect server if there is a connection error
                    cnx_system_db = None
                    cursor_system_db = None
            Severity: Minor
            Found in myems-normalization/virtualpoint.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/energy_storage_container_energy_charge.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/shopfloor_energy_input_category.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/space_energy_input_item.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/equipment_energy_output_category.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/shopfloor_energy_input_item.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/combined_equipment_energy_input_category.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 main has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
            Open

            def main(logger):
            
                while True:
                    # the outermost while loop
                    ################################################################################################################
            Severity: Minor
            Found in myems-aggregation/store_energy_input_category.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

            Severity
            Category
            Status
            Source
            Language