Showing 5,781 of 10,536 total issues

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

                                function ($ocLazyLoad) {
                                    return $ocLazyLoad.load(['ui.select', 'ui.checkbox', 'toaster']).then(
                                        function () {
                                            return $ocLazyLoad.load([{
                                                files: ['js/plugins/footable/footable.all.min.js', 'css/plugins/footable/footable.core.css']
Severity: Minor
Found in myems-admin/app/config.router.js - About 1 hr to fix

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

    function icheck($timeout) {
        return {
            restrict: 'A',
            require: 'ngModel',
            link: function($scope, element, $attrs, ngModel) {
    Severity: Minor
    Found in myems-admin/app/directives/directives.js - About 1 hr to fix

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

      const Login = () => {
        return (
          <AuthCardLayout
            leftSideContent={
              <Fragment>
      Severity: Minor
      Found in myems-web/src/components/auth/card/Login.js - About 1 hr to fix

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

                                        function ($ocLazyLoad) {
                                            return $ocLazyLoad.load(['ui.select', 'toaster', 'integralui']).then(
                                                function () {
                                                    return $ocLazyLoad.load([{
                                                        files: [
        Severity: Minor
        Found in myems-admin/app/config.router.js - About 1 hr to fix

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

          const ImageLightbox = () => {
            const images = [img1, img2, img3, img4];
          
            return (
              <Fragment>
          Severity: Minor
          Found in myems-web/src/components/plugins/ImageLightbox.js - About 1 hr to fix

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

              const batchDelete = () => {
                let rows = table.current.selectionContext.selected;
                if (rows.length <= 0) {
                  toast.error(t('Select Row'));
                  return;
            Severity: Minor
            Found in myems-web/src/components/MyEMS/Notification/Notification.js - About 1 hr to fix

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

              const NavbarStandard = () => {
                const [navbarCollapsed, setNavbarCollapsed] = useState(true);
              
                useEffect(() => {
                  window.addEventListener('scroll', handleNavbarTransparency);
              Severity: Minor
              Found in myems-web/src/components/navbar/NavbarStandard.js - About 1 hr to fix

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

                  const batchRead = () => {
                    let rows = table.current.selectionContext.selected;
                    if (rows.length <= 0) {
                      toast.error(t('Select Row'));
                      return;
                Severity: Minor
                Found in myems-web/src/components/MyEMS/Notification/Notification.js - About 1 hr to fix

                  Function on_get has 28 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/tenant.py - About 1 hr to fix

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

                        def on_put(req, resp, id_):
                            """Handles PUT requests"""
                            admin_control(req)
                            try:
                                raw_json = req.stream.read().decode('utf-8')
                    Severity: Minor
                    Found in myems-api/core/notification.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):
                              """Handles POST requests"""
                              admin_control(req)
                              try:
                                  raw_json = req.stream.read().decode('utf-8')
                      Severity: Minor
                      Found in myems-api/core/emailserver.py - About 1 hr to fix

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

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

                          Function chart has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          angles.chart = function (type) {
                              return {
                                  restrict: "A",
                                  scope: {
                                      data: "=",
                          Severity: Minor
                          Found in myems-admin/js/plugins/chartJs/angles.js - 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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          jvm.Legend.prototype.render = function(){
                            var ticks = this.series.scale.getTicks(),
                                i,
                                inner = jvm.$('<div/>').addClass('jvectormap-legend-inner'),
                                tick,
                          Severity: Minor
                          Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 applyAttr has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          jvm.SVGImageElement.prototype.applyAttr = function(attr, value){
                            var that = this;
                          
                            if (attr == 'image') {
                              jvm.whenImageLoaded(value).then(function(img){
                          Severity: Minor
                          Found in myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js - 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 UserForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const UserForm = () => {
                            const { isRTL } = useContext(AppContext);
                            const { user, setUser, step, setStep } = useContext(AuthWizardContext);
                            const { register, handleSubmit, errors, watch } = useForm();
                          
                          
                          Severity: Minor
                          Found in myems-web/src/components/auth/wizard/UserForm.js - 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 Message has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const Message = ({ message, senderUserId, status, time, isGroup }) => {
                            const { users } = useContext(ChatContext);
                            const user = users.find(({ id }) => id === senderUserId);
                            const name = user?.name.split(' ')[0];
                            const isLeft = senderUserId !== 3;
                          Severity: Minor
                          Found in myems-web/src/components/chat/content/Message.js - 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 SentForgotPasswordEmailMessageForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const SentForgotPasswordEmailMessageForm = ({ setRedirect, setRedirectUrl, hasLabel, layout, t }) => {
                            // State
                            const [email, setEmail] = useState(getItemFromStore('email', ''));
                            const [code, setCode] = useState('');
                            const [isdisabled, setIsDisabled] = 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 ProductList has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const ProductList = ({
                            id,
                            files,
                            title,
                            category,
                          Severity: Minor
                          Found in myems-web/src/components/e-commerce/product/ProductList.js - 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 SentRegisterEmailMessageForm has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const SentRegisterEmailMessageForm = ({ setRedirect, setRedirectUrl, hasLabel, layout, t }) => {
                            // State
                            const [email, setEmail] = useState('');
                            const [code, setCode] = useState('');
                            const [isdisabled, setIsDisabled] = useState(false);
                          Severity: Minor
                          Found in myems-web/src/components/MyEMS/auth/SentRegisterEmailMessageForm.js - 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

                          Severity
                          Category
                          Status
                          Source
                          Language