sentilo/sentilo

View on GitHub

Showing 627 of 1,220 total issues

Avoid too many return statements within this function.
Open

                return results;
Severity: Major
Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return select( selector.replace( rtrim, "$1" ), context, results, seed );
    Severity: Major
    Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      return this.constructor( context ).find( selector );
      Severity: Major
      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return results;
        Severity: Major
        Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return results;
          Severity: Major
          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                        return this;
            Severity: Major
            Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return i ?
                          // Do a sibling check if the nodes have a common ancestor
                          siblingCheck( ap[i], bp[i] ) :
              
                          // Otherwise nodes in our document sort first
              Severity: Major
              Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return results;
                Severity: Major
                Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return ret == null ?
                                  undefined :
                                  ret;
                  Severity: Major
                  Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return (Math.round(res))
                    Severity: Major
                    Found in sentilo-catalog-web/src/main/webapp/static/js/sentilo/metrics.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                              return jQuery.makeArray( selector, this );
                      Severity: Major
                      Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                        return elem[ name ];
                        Severity: Major
                        Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return compare & 4 ? -1 : 1;
                          Severity: Major
                          Found in sentilo-catalog-web/src/main/webapp/static/js/jquery-1.9.0.js - About 30 mins to fix

                            Method validateAdminPermissions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              private void validateAdminPermissions(final PermissionsDTO permissions, final Errors errors) {
                                final String currentTenant = TenantUtils.getCurrentTenant();
                                // It isn't possible to create ADMIN permissions over third party entities
                                for (final String applicationId : permissions.getSelectedApplicationsIds()) {
                                  if (!applicationService.isApplicationFromTenant(applicationId, currentTenant)) {

                            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

                            Method equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              @Override
                              public boolean equals(final Object obj) {
                                if (this == obj) {
                                  return true;
                                }

                            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

                            Method equals has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              @Override
                              public boolean equals(final Object obj) {
                                if (this == obj) {
                                  return true;
                                }

                            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

                            Method doDelete has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              protected <V extends CatalogDocument> void doDelete(final Query query, final Class<V> resourceType) {
                                if (SyncResource.class.isAssignableFrom(resourceType)) {
                            
                                  final String collectionName = getMongoOps().getCollectionName(resourceType);
                                  final Query queryFiltered = query;

                            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

                            Method updateResourceTenantsAuthByProvider has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              private void updateResourceTenantsAuthByProvider(final String providerId, final String tenantId, final boolean addGrant) {
                            
                                // Update the Provider tenants authorization list, and list visible configuration, adding or
                                // removing values as needed and updating dependent elements too (alert, application, component,
                                // sensor)

                            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

                            Method buildSensorsFromCatalogSensors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              public static final List<Sensor> buildSensorsFromCatalogSensors(final ApiConverterContext context) {
                                final List<Sensor> sensors = new ArrayList<Sensor>();
                                final List<CatalogSensor> catalogSensors = context.getMessage().getSensors();
                            
                                if (!CollectionUtils.isEmpty(catalogSensors)) {

                            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

                            Method canSectorialUserAtLeastReadResource has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                            Open

                              @SuppressWarnings("unchecked")
                              public static boolean canSectorialUserAtLeastReadResource(final CatalogUserDetails sectorialUser, final CatalogDocument resource) {
                                boolean allowed = false;
                                final boolean isSectorialResource = resource instanceof SectorResource<?>;
                                final boolean isSectorialGrantResource = resource instanceof SectorResourceGranted;

                            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