trusona/trusona-server-sdk-java

View on GitHub

Showing 6 of 11 total issues

TrusonaficationResponse has 37 methods (exceeds 20 allowed). Consider refactoring.
Open

@SuppressFBWarnings(value = {"EI_EXPOSE_REP", "EI_EXPOSE_REP2"}, justification = "Instance is not accessed by untrusted code")
public class TrusonaficationResponse extends BaseDto {

  private static final long serialVersionUID = 3555946086952925089L;

    Method getPairedTruCode has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      @Override
      public TruCode getPairedTruCode(UUID id, Long timeout) throws TrusonaException {
        long stopTime = System.currentTimeMillis() + timeout;
        StopWatch stopWatch = StopWatch.createStarted();
    
    
    Severity: Minor
    Found in trusona-sdk/src/main/java/com/trusona/sdk/Trusona.java - 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

    Method handleErrors has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

      @Override
      public void handleErrors(Response<?> response) throws TrusonaException {
        if (response.isSuccessful()) {
          return;
        }

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

      @Override
      public TrusonaficationResult createTrusonafication(Trusonafication trusonafication) throws TrusonaException {
        TrusonaficationService service = serviceGenerator.getService(TrusonaficationService.class);
    
        ErrorHandler cannotBeCompletedErrorHandler = new BaseErrorHandler() {

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

      public static TrusonaAuthorizationHeader parseAuthorizationHeader(String rawHeaderValue) {
        String headerValue = StringUtils.trimToNull(rawHeaderValue);
    
        if (headerValue != null) {
          String[] headerParts = StringUtils.split(headerValue);

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

      private Response validateResponse(Response incomingResponse) throws IOException {
        if (!incomingResponse.isSuccessful()) {
          return incomingResponse;
        }
    
    

    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