DrFelder/ppr

View on GitHub

Showing 56 of 62 total issues

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

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

Severity: Minor
Found in src/main/java/is/surreal/ppr/model/Operationparticipation.java - About 4 hrs 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 equals has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    @JsonIgnore
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
Severity: Minor
Found in src/main/java/is/surreal/ppr/model/Address.java - About 4 hrs 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 equals has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

Severity: Minor
Found in src/main/java/is/surreal/ppr/model/Operation.java - About 4 hrs 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 equals has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

Severity: Minor
Found in src/main/java/is/surreal/ppr/model/User.java - About 3 hrs 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

Operation has 25 methods (exceeds 20 allowed). Consider refactoring.
Open

@Entity
public class Operation {
    private Long id;
    private String title;
    private Date date;
Severity: Minor
Found in src/main/java/is/surreal/ppr/model/Operation.java - About 2 hrs to fix

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

        @Override
        @JsonIgnore
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
    Severity: Minor
    Found in src/main/java/is/surreal/ppr/model/Userdata.java - About 2 hrs 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

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

    @Entity
    public class Operationparticipation {
        private Long id;
        private Long userId;
        private Byte accepted;
    Severity: Minor
    Found in src/main/java/is/surreal/ppr/model/Operationparticipation.java - About 2 hrs to fix

      User has 21 methods (exceeds 20 allowed). Consider refactoring.
      Open

      @Entity
      public class User {
          private Long id;
          private String username;
          private String password;
      Severity: Minor
      Found in src/main/java/is/surreal/ppr/model/User.java - About 2 hrs to fix

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

            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
        
        
        Severity: Minor
        Found in src/main/java/is/surreal/ppr/model/Helper.java - About 2 hrs 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 equals has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
        Open

            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
        
        
        Severity: Minor
        Found in src/main/java/is/surreal/ppr/model/Equipment.java - About 2 hrs 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 getCurrentPrivileges has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

            @GetMapping("/{operationId}")
            @PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
            String getCurrentPrivileges(@PathVariable Long operationId) {
                Authentication auth = SecurityContextHolder.getContext().getAuthentication();
                Long userId = this.userRepository.findByUsername(auth.getName()).getId();

        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 cssLoaders has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        exports.cssLoaders = function (options) {
          options = options || {}
        
          const cssLoader = {
            loader: 'css-loader',
        Severity: Minor
        Found in frontend/build/utils.js - About 1 hr to fix

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

              @Override
              public boolean equals(Object o) {
                  if (this == o) return true;
                  if (o == null || getClass() != o.getClass()) return false;
          
          
          Severity: Minor
          Found in src/main/java/is/surreal/ppr/model/Notification.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 getNewNotifications has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              @GetMapping
              @PreAuthorize("hasAuthority('ADMIN_USER') or hasAuthority('STANDARD_USER')")
              Iterable<Notification> getNewNotifications() {
                  Set<Notification> notificationHashSet = new HashSet<>();
                  Authentication auth = SecurityContextHolder.getContext().getAuthentication();
          Severity: Minor
          Found in src/main/java/is/surreal/ppr/controller/NotificationController.java - About 55 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 equals has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              @Override
              public boolean equals(Object o) {
                  if (this == o) return true;
                  if (o == null || getClass() != o.getClass()) return false;
          
          
          Severity: Minor
          Found in src/main/java/is/surreal/ppr/model/Notificationread.java - About 55 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

          Function cssLoaders has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

          exports.cssLoaders = function (options) {
            options = options || {}
          
            const cssLoader = {
              loader: 'css-loader',
          Severity: Minor
          Found in frontend/build/utils.js - About 45 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

          Avoid too many return statements within this method.
          Open

                  if (accepted != null ? !accepted.equals(that.accepted) : that.accepted != null) return false;
          Severity: Major
          Found in src/main/java/is/surreal/ppr/model/Operationparticipation.java - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    if (helperId != null ? !helperId.equals(that.helperId) : that.helperId != null) return false;
            Severity: Major
            Found in src/main/java/is/surreal/ppr/model/Operationparticipation.java - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return true;
              Severity: Major
              Found in src/main/java/is/surreal/ppr/model/User.java - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                        if (birthday != null ? !birthday.equals(userdata.birthday) : userdata.birthday != null) return false;
                Severity: Major
                Found in src/main/java/is/surreal/ppr/model/Userdata.java - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language