Showing 5,781 of 10,536 total issues

Function generate_excel has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

def generate_excel(report,
Severity: Minor
Found in myems-api/excelexporters/energystoragepowerstationreportingparameters.py - About 35 mins to fix

    Function export has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def export(report, name, reporting_start_datetime_local, reporting_end_datetime_local, language):
    Severity: Minor
    Found in myems-api/excelexporters/energystoragepowerstationreportingparameters.py - About 35 mins to fix

      Function generate_excel has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def generate_excel(report, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
      Severity: Minor
      Found in myems-api/excelexporters/tenantbatch.py - About 35 mins to fix

        Function generate_excel has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def generate_excel(report, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
        Severity: Minor
        Found in myems-api/excelexporters/storebatch.py - About 35 mins to fix

          Function export has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          def export(result, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
          Severity: Minor
          Found in myems-api/excelexporters/storebatch.py - About 35 mins to fix

            Function export has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def export(result, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
            Severity: Minor
            Found in myems-api/excelexporters/shopfloorbatch.py - About 35 mins to fix

              Function generate_excel has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              def generate_excel(report, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
              Severity: Minor
              Found in myems-api/excelexporters/shopfloorbatch.py - About 35 mins to fix

                Function export has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                def export(result, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
                Severity: Minor
                Found in myems-api/excelexporters/meterbatch.py - About 35 mins to fix

                  Function generate_excel has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  def generate_excel(report, space_name, reporting_start_datetime_local, reporting_end_datetime_local, language):
                  Severity: Minor
                  Found in myems-api/excelexporters/meterbatch.py - About 35 mins to fix

                    Function write_log has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    def write_log(user_uuid, request_method, resource_type, resource_id, request_body):
                    Severity: Minor
                    Found in myems-api/core/useractivity.py - About 35 mins to fix

                      Function applyAttr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jvm.SVGShapeElement.prototype.applyAttr = function(attr, value){
                        var patternEl,
                            imageEl,
                            that = this;
                      
                      
                      Severity: Minor
                      Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 DataSeries has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jvm.DataSeries = function(params, elements, map) {
                        var scaleConstructor;
                      
                        params = params || {};
                        params.attribute = params.attribute || 'fill';
                      Severity: Minor
                      Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 setSelected has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        setSelected: function(type, keys){
                          var i;
                      
                          if (typeof keys != 'object') {
                            keys = [keys];
                      Severity: Minor
                      Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 applyAttr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      jvm.VMLShapeElement.prototype.applyAttr = function(attr, value){
                        switch (attr) {
                          case 'fill':
                            this.node.fillcolor = value;
                            break;
                      Severity: Minor
                      Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 People has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const People = ({ peoples = rawPeople.length, className }) => {
                        const { loading, data: people, setData: setPeople } = useFakeFetch(rawPeople);
                      
                        const searchPeople = ({ target }) => {
                          const keyword = target.value.toLowerCase();
                      Severity: Minor
                      Found in myems-web/src/components/page/People.js - 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 useBulkSelect has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const useBulkSelect = items => {
                        const [selectedItems, setSelectedItems] = useState([]);
                        const [isAllSelected, setIsAllSelected] = useState(false);
                        const [isIndeterminate, setIsIndeterminate] = useState(false);
                      
                      
                      Severity: Minor
                      Found in myems-web/src/hooks/useBulkSelect.js - 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 DistributionSystem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const DistributionSystem = ({ setRedirect, setRedirectUrl, t }) => {
                        useEffect(() => {
                          let is_logged_in = getCookieValue('is_logged_in');
                          let user_name = getCookieValue('user_name');
                          let user_display_name = getCookieValue('user_display_name');
                      Severity: Minor
                      Found in myems-web/src/components/MyEMS/AuxiliarySystem/DistributionSystem.js - 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 Notification has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const Notification = ({ setRedirect, setRedirectUrl, t }) => {
                        let current_moment = moment();
                        const [startDatetime, setStartDatetime] = useState(current_moment.clone().subtract(1, 'months'));
                        const [endDatetime, setEndDatetime] = useState(current_moment);
                        const [status, setStatus] = useState('all');
                      Severity: Minor
                      Found in myems-web/src/components/MyEMS/Notification/Notification.js - 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 CollectionDashboard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const CollectionDashboard = ({ setRedirect, setRedirectUrl, t }) => {
                        const [isDashboardFetched, setIsDashboardFetched] = useState(false);
                        const [isEnergyStoragePowerStationCollectionEnergyFetched, setIsEnergyStoragePowerStationCollectionEnergyFetched] = useState(false);
                        const [isEnergyStoragePowerStationCollectionBillingFetched, setIsEnergyStoragePowerStationCollectionBillingFetched] = useState(false);
                        const [isEnergyStoragePowerStationCollectionCarbonFetched, setIsEnergyStoragePowerStationCollectionCarbonFetched] = useState(false);

                      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 CartModal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const CartModal = ({ type, id, quantity, title, files, price, sale, modal, setModal }) => {
                        const { currency } = useContext(AppContext);
                        if (!id) return null;
                        return (
                          <Modal isOpen={modal} toggle={() => setModal(!modal)} size="lg">
                      Severity: Minor
                      Found in myems-web/src/components/e-commerce/shopping-cart/CartModal.js - 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

                      Severity
                      Category
                      Status
                      Source
                      Language