Showing 391 of 391 total issues

Method create has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @Override
    @SuppressWarnings("unchecked")
    public Optional<UserProfile> create(final CallContext ctx, final Credentials credentials) {
        init();

    YahooProfile has 24 methods (exceeds 20 allowed). Consider refactoring.
    Open

    @SuppressWarnings("unchecked")
    public class YahooProfile extends OAuth10Profile {
    
        @Serial
        private static final long serialVersionUID = 791758805376191144L;

      JEEContext has 24 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @Deprecated
      public class JEEContext implements WebContext {
      
          private final HttpServletRequest request;
      
      
      Severity: Minor
      Found in pac4j-javaee/src/main/java/org/pac4j/jee/context/JEEContext.java - About 2 hrs to fix

        JEEContext has 24 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class JEEContext implements WebContext {
        
            private final HttpServletRequest request;
        
            private final HttpServletResponse response;
        Severity: Minor
        Found in pac4j-jakartaee/src/main/java/org/pac4j/jee/context/JEEContext.java - About 2 hrs to fix

          SAML2MessageContext has 24 methods (exceeds 20 allowed). Consider refactoring.
          Open

          @Getter
          @Setter
          @ToString
          public class SAML2MessageContext {
          
          

            Method tryCreateOidcClient has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public void tryCreateOidcClient(final Collection<Client> clients) {
                    for (var i = 0; i <= MAX_NUM_CLIENTS; i++) {
                        val id = getProperty(OIDC_ID, i);
                        if (isNotBlank(id)) {
                            val configuration = new OidcConfiguration();

              Method renewSession has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected void renewSession(final CallContext ctx, final Config config) {
                      val context = ctx.webContext();
                      val sessionStore = ctx.sessionStore();
              
                      val optOldSessionId = sessionStore.getSessionId(context, 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

              GitHubProfile has 23 methods (exceeds 20 allowed). Consider refactoring.
              Open

              public class GitHubProfile extends OAuth20Profile {
              
                  @Serial
                  private static final long serialVersionUID = -8030906034414268058L;
              
              

                CommonHelper has 23 methods (exceeds 20 allowed). Consider refactoring.
                Open

                public final class CommonHelper {
                
                    /**
                     * Return if the String is not blank.
                     *
                Severity: Minor
                Found in pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java - About 2 hrs to fix

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  package org.pac4j.jee.saml.metadata;
                  
                  import lombok.Getter;
                  import lombok.Setter;
                  import lombok.val;
                  pac4j-jakartaee/src/main/java/org/pac4j/jee/saml/metadata/Saml2MetadataFilter.java on lines 1..72

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 160.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Identical blocks of code found in 2 locations. Consider refactoring.
                  Open

                  package org.pac4j.jee.saml.metadata;
                  
                  import jakarta.servlet.FilterChain;
                  import jakarta.servlet.FilterConfig;
                  import jakarta.servlet.ServletException;
                  pac4j-javaee/src/main/java/org/pac4j/jee/saml/metadata/Saml2MetadataFilter.java on lines 1..72

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 160.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  WebContext has 23 methods (exceeds 20 allowed). Consider refactoring.
                  Open

                  public interface WebContext {
                  
                      /**
                       * Return a request parameter.
                       *
                  Severity: Minor
                  Found in pac4j-core/src/main/java/org/pac4j/core/context/WebContext.java - About 2 hrs to fix

                    DefaultSOAPPipelineFactory has 23 methods (exceeds 20 allowed). Consider refactoring.
                    Open

                    @SuppressWarnings("unchecked")
                    public class DefaultSOAPPipelineFactory implements HttpClientMessagePipelineFactory {
                        protected final SAML2Configuration configuration;
                    
                        protected final SAML2MetadataResolver idpMetadataResolver;

                      Config has 23 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      @Setter
                      @Getter
                      @With
                      @AllArgsConstructor
                      @Accessors(chain = true)
                      Severity: Minor
                      Found in pac4j-core/src/main/java/org/pac4j/core/config/Config.java - About 2 hrs to fix

                        FacebookMusicListen has 22 methods (exceeds 20 allowed). Consider refactoring.
                        Open

                        public final class FacebookMusicListen implements Serializable {
                        
                            @Serial
                            private static final long serialVersionUID = 3904637830042371121L;
                        
                        

                          FacebookPhoto has 22 methods (exceeds 20 allowed). Consider refactoring.
                          Open

                          public final class FacebookPhoto implements Serializable {
                          
                              @Serial
                              private static final long serialVersionUID = -1230468571423177489L;
                          
                          

                            UserProfile has 22 methods (exceeds 20 allowed). Consider refactoring.
                            Open

                            @JsonTypeInfo(use = JsonTypeInfo.Id.CLASS, include = JsonTypeInfo.As.PROPERTY, property = "class")
                            public interface UserProfile extends Serializable {
                            
                                /**
                                 * <p>getId.</p>
                            Severity: Minor
                            Found in pac4j-core/src/main/java/org/pac4j/core/profile/UserProfile.java - About 2 hrs to fix

                              Method convert has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  @Override
                                  public FacebookRelationshipStatus convert(final Object attribute) {
                                      if (attribute != null) {
                                          if (attribute instanceof String) {
                                              var s = ((String) attribute).toLowerCase();

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

                                  @Override
                                  public Optional<Credentials> extract(final CallContext ctx) {
                                      val webContext = ctx.webContext();
                              
                                      var username = Optional.<String>empty();

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

                                  @Override
                                  public boolean storeMetadata(final String metadata, final boolean force) throws Exception {
                                      if (metadataResource == null || CommonHelper.isBlank(metadata)) {
                                          logger.info("No metadata or resource is provided");
                                          return 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

                              Severity
                              Category
                              Status
                              Source
                              Language