Showing 391 of 391 total issues

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

    @Override
    public FoursquareProfile extractUserProfile(String body) {
        var profile = (FoursquareProfile) newProfile();
        var json = JsonHelper.getFirstNode(body);
        if (json == null) {

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

    @Override
    protected Optional<UserProfile> retrieveUserProfileFromToken(final WebContext context, final Token accessToken) {
        super.retrieveUserProfileFromToken(context, accessToken);
        val profileDefinition = (LinkedIn2ProfileDefinition) configuration.getProfileDefinition();
        val linkedin2Configuration = (LinkedIn2Configuration) configuration;

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

    @Override
    public VkProfile extractUserProfile(final String body) {
        val profile = (VkProfile) newProfile();
        var json = JsonHelper.getFirstNode(body);
        if (json != null) {

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

    @Override
    public DropBoxProfile extractUserProfile(final String body) {
        val profile = (DropBoxProfile) newProfile();
        var json = JsonHelper.getFirstNode(body);
        if (json != null) {

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

    @Override
    public void convertAndAdd(UserProfile profile, AttributeLocation attributeLocation, String name, Object value) {
        if (value instanceof Map) {
            var jsonObject = (Map<String, ?>) value;
            jsonObject.forEach((key, objectValue) -> super.convertAndAdd(profile, attributeLocation, key, objectValue));
Severity: Minor
Found in pac4j-jwt/src/main/java/org/pac4j/jwt/profile/JwtProfileDefinition.java - 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

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

    @Override
    public FigShareProfile extractUserProfile(final String body) {
        val profile = (FigShareProfile) newProfile();
        val json = JsonHelper.getFirstNode(body);
        if (json != null) {

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

    @Override
    public String get(final WebContext context, final SessionStore sessionStore) {
        String token = null;

        val optCurrentToken = sessionStore.get(context, Pac4jConstants.CSRF_TOKEN);

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

    public void tryCreateFacebookClient(final Collection<Client> clients) {
        val id = getProperty(FACEBOOK_ID);
        val secret = getProperty(FACEBOOK_SECRET);
        val scope = getProperty(FACEBOOK_SCOPE);
        val fields = getProperty(FACEBOOK_FIELDS);
Severity: Minor
Found in pac4j-config/src/main/java/org/pac4j/config/builder/OAuthBuilder.java - 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

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

    public void tryCreateCasClient(final Collection<Client> clients) {
        for (var i = 0; i <= MAX_NUM_CLIENTS; i++) {
            val loginUrl = getProperty(CAS_LOGIN_URL, i);
            val protocol = getProperty(CAS_PROTOCOL, i);
            if (isNotBlank(loginUrl)) {

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

    public void tryCreateIndirectBasicAuthClient(final Collection<Client> clients) {
        for (var i = 0; i <= MAX_NUM_CLIENTS; i++) {
            val authenticator = getProperty(INDIRECTBASICAUTH_AUTHENTICATOR, i);
            if (isNotBlank(authenticator)) {
                val indirectBasicAuthClient = new IndirectBasicAuthClient();

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

        @Override
        public KerberosTicketValidation run() throws Exception {
            var responseToken = new byte[0];
            GSSName gssName = null;
            var context = GSSManager.getInstance().createContext((GSSCredential) null);

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