rwwarren/door-lock

View on GitHub

Showing 33 of 383 total issues

Function renderLoginPage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  renderLoginPage: function() {
    if(this.state.loaded && this.state.responseData.success === "1"){
      AsyncStorage.setItem(STORAGE_KEY, this.state.sid).done();
      return this.userPage();
    }
Severity: Minor
Found in mobile/app/doorlock-app/LoginPage.js - About 1 hr to fix

    Function userPage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      userPage: function(){
        //FIX THIS LOGIN
        //USE NAVIGATOR
        var prev = this.props.route;
        console.log("this route: " + this.props.route);
    Severity: Minor
    Found in mobile/app/doorlock-app/LoginPage.js - About 1 hr to fix

      Method updateOtherUser has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          @ApiOperation("Update other user")
          @POST
          @Timed
          @Consumes(MediaType.APPLICATION_JSON)
          @Path("/UpdateOtherUser")

        Function changeUserInfo has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

        function changeUserInfo(){
          if (isset($_SESSION['username']) && isset($_POST['oldPwd']) && isset($_POST['newPwd']) && isset($_POST['authy']) &&
              isset($_POST['card']) && isset($_POST['email']) && isset($_POST['name']) && isset($_POST['confNewPass']) ){
            $username = $_SESSION['username'];
            $oldPassword = mysql_real_escape_string($_POST['oldPwd']);
        Severity: Minor
        Found in mobile/web/src/root/userFunctions.php - 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 registerUser has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            int registerUser(@Bind("name") String name, @Bind("username") String username, @Bind("password") String password,
                             @Bind("email") String email, @Bind("authyId") long authyId, @Bind("cardId") String cardId,
                             @Bind("isAdmin") boolean isAdmin);
        Severity: Major
        Found in api/src/main/java/com/wrixton/doorlock/DAO/QueryDAO.java - About 50 mins to fix

          Method updateCurrentUser has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              int updateCurrentUser(@Bind("name") String name, @Bind("email") String email, @Bind("authyId") long authyId,
                                        @Bind("cardId") String cardId, @Bind("isAdmin") boolean isAdmin, @Bind("username") String username,
                                        @Bind("password") String password);
          Severity: Major
          Found in api/src/main/java/com/wrixton/doorlock/DAO/QueryDAO.java - About 50 mins to fix

            Method equals has a Cognitive Complexity of 8 (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;
                    DoorlockUserLoginCheck that = (DoorlockUserLoginCheck) o;
            Severity: Minor
            Found in api/src/main/java/com/wrixton/doorlock/DAO/DoorlockUserLoginCheck.java - 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

            Method equals has a Cognitive Complexity of 8 (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;
                    LoginRequest that = (LoginRequest) o;
            Severity: Minor
            Found in api/src/main/java/com/wrixton/doorlock/LoginRequest.java - 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

            Consider simplifying this complex logical expression.
            Open

              if (isset($_POST['personName']) && isset($_POST['username'])&& isset($_POST['password']) && isset($_POST['email']) && isAdmin() && isset($_POST['admin'])){
                $personName = $_POST['personName'];
                $username = $_POST['username'];
                $password = $_POST['password'];
                $email = $_POST['email'];
            Severity: Major
            Found in mobile/web/src/root/userFunctions.php - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if(username && password && name && isValidEmail && (!authyID || this.validateAuthyID(authyID))){
                    $.ajax({
                      url: common.API_URL + common.REGISTER_USER,
                      type: "POST",
                      contentType: "application/json",
              Severity: Major
              Found in web/src/inc/Admin.js - About 40 mins to fix

                Method equals has a Cognitive Complexity of 7 (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;
                        ResetPasswordRequest that = (ResetPasswordRequest) o;
                Severity: Minor
                Found in api/src/main/java/com/wrixton/doorlock/ResetPasswordRequest.java - About 35 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 forgotPassword has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                function forgotPassword(){
                  if(isset($_GET['resetToken']) && isset($_POST['pass']) && isset($_POST['confirmPass']) ){
                    $resetToken = $_GET['resetToken'];
                    $pass = $_POST['pass'];
                    $otherPass = $_POST['confirmPass'];
                Severity: Minor
                Found in mobile/web/src/root/userFunctions.php - 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 equals has a Cognitive Complexity of 6 (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;
                        LoginStatus that = (LoginStatus) o;
                Severity: Minor
                Found in api/src/main/java/com/wrixton/doorlock/DAO/LoginStatus.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

                Severity
                Category
                Status
                Source
                Language