Showing 5,603 of 10,032 total issues

Avoid too many return statements within this function.
Open

        return result_rows_yearly
Severity: Major
Found in myems-api/core/utilities.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return list(), None, None, None, None, None, None
    Severity: Major
    Found in myems-api/core/utilities.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return result_rows_monthly
      Severity: Major
      Found in myems-api/core/utilities.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return dict()
        Severity: Major
        Found in myems-api/core/utilities.py - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return dict()
          Severity: Major
          Found in myems-api/core/utilities.py - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return {k: v for k, v in result.items() if start_datetime_utc <= k <= end_datetime_utc}
            Severity: Major
            Found in myems-api/core/utilities.py - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return list()
              Severity: Major
              Found in myems-api/core/utilities.py - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return result_rows_yearly, average, maximum
                Severity: Major
                Found in myems-api/core/utilities.py - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return result_rows_yearly, mean, median, minimum, maximum, stdev, variance
                  Severity: Major
                  Found in myems-api/core/utilities.py - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return result_rows_monthly, mean, median, minimum, maximum, stdev, variance
                    Severity: Major
                    Found in myems-api/core/utilities.py - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return result_rows_monthly, average, maximum
                      Severity: Major
                      Found in myems-api/core/utilities.py - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return list(), None, None
                        Severity: Major
                        Found in myems-api/core/utilities.py - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return
                          Severity: Major
                          Found in myems-api/core/useractivity.py - About 30 mins to fix

                            Function detectVerticalSquash has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            var detectVerticalSquash = function detectVerticalSquash(img) {
                              var iw = img.naturalWidth;
                              var ih = img.naturalHeight;
                              var canvas = document.createElement("canvas");
                              canvas.width = 1;
                            Severity: Minor
                            Found in myems-admin/js/plugins/dropzone/dropzone.js - 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 getValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              getValue: function(value) {
                                var lengthes = [],
                                    fullLength = 0,
                                    l,
                                    i = 0,
                            Severity: Minor
                            Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 WizardInput has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const WizardInput = ({
                              label,
                              id,
                              name,
                              errors,
                            Severity: Minor
                            Found in myems-web/src/components/auth/wizard/WizardInput.js - 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 Notifications has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const Notifications = ({ items = rawNotifications.length, children }) => {
                              const { loading, data: notifications, setData: setNotifications } = useFakeFetch(rawNotifications);
                              const [settingsIsOpen, setSettingsIsOpen] = useState(false);
                            
                              const toggleSettingsModal = () => setSettingsIsOpen(!settingsIsOpen);
                            Severity: Minor
                            Found in myems-web/src/components/page/Notifications.js - 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 LastMessage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const LastMessage = (lastMessage, thread) => {
                              const { users } = useContext(ChatContext);
                              const user = users.find(({ id }) => id === lastMessage?.senderUserId);
                              const name = user?.name.split(' ');
                              const lastMassagePreview =
                            Severity: Minor
                            Found in myems-web/src/components/chat/sidebar/LastMessage.js - 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 IconStatus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const IconStatus = ({ id }) => {
                              const { feeds, feedDispatch } = useContext(FeedContext);
                            
                              const [active, setActive] = useState(false);
                              const targetedFeed = feeds.find(feed => feed.id === id);
                            Severity: Minor
                            Found in myems-web/src/components/feed/IconStatus.js - 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 minimalizaSidebar has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function minimalizaSidebar($timeout) {
                                return {
                                    restrict: 'A',
                                    template: '<a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="" ng-click="minimalize()"><i class="fa fa-bars"></i></a>',
                                    controller: function ($scope, $element) {
                            Severity: Minor
                            Found in myems-admin/app/directives/directives.js - 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

                            Severity
                            Category
                            Status
                            Source
                            Language