alsutton/enterprisepasswordsafe

View on GitHub

Showing 189 of 206 total issues

Method searchHierarchy has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public void searchHierarchy(final HierarchyNodeDAO hnDAO, final HierarchyNode node, final User theUser,
                                final NodeObjectAction action, final boolean recurse) {

    Method createTamperstamp has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public byte[] createTamperstamp(User theUser, final long datetime, final String event,
                                        final String itemId, final String userId)

      Method setRule has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private void setRule(UserIPZoneRestrictionDAO uipzrDAO, UserIPZoneRestriction restriction,
                               String zoneId, String userId, String rule)

        Method importFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            private void importFile(HttpServletRequest request, User importingUser, String parentNode,
                                     ImportStatus importStatus, FileItem fileItem)

          Method processResults has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private List<EventsForDay> processResults(final ResultSet rs, User fetchingUser, Group adminGroup,
                                                       final boolean includePersonal, final boolean validateTamperstamp)

            Method create has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public void create( final String logLevel, final User theUser, final AccessControledObject item,
                                    final String message, final boolean sendEmail )

              Method doPost has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
                          throws IOException, ServletException {
                      request.setAttribute("error_page", "/system/CreatePassword");
                      try {

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

                  Map<String, String> extractCustomFieldsFromRequest(HttpServletRequest request) {
                      Map<String,String> customFields = new TreeMap<>();
                      int cfCount = -1;
              
                      while( 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

              Method santiseName has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static String santiseName(final String originalName) {
                      StringBuilder endName = new StringBuilder(originalName.length());
                      
                      boolean capsNext = false;
                      for(char c : originalName.toCharArray()) {

              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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public boolean equals(GenericJDBCConnectionInformation otherConfig) {
                      return otherConfig != null && (dbType.equals(otherConfig.dbType)
                          && driver.equals(otherConfig.driver) && url.equals(otherConfig.url)
                          && username.equals(otherConfig.username) && password.equals(otherConfig.password));
                  }

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

                  public final Map<String,String> getRulesForUser( final String id ) throws SQLException {
                      Map<String,String> rules = new HashMap<>();
                      try(PreparedStatement ps = BOMFactory.getCurrentConntection().prepareStatement(GET_BY_USER_ID_SQL)) {
                          ps.setString(1, id);
                          try(ResultSet rs = ps.executeQuery()) {

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

                  @Override
                  public void doFilter(ServletRequest request, ServletResponse response,
                          FilterChain next) throws ServletException, IOException {
                      try {
                          next.doFilter(request, response);

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

                  private void setRestrictedAccess(final HttpServletRequest request, final Password password ) {
                      String raEnabled = request.getParameter("ra_enabled");
                      if( raEnabled != null && raEnabled.equals("Y") ) {
                          password.setRaEnabled(true);
                          String approvers = request.getParameter("ra_approvers");

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

                  @Override
                  protected void doPost( final HttpServletRequest request, final HttpServletResponse response)
                          throws ServletException, IOException {
                      String id = request.getParameter(SecurityUtils.USER_ID_PARAMETER);
                      String internalpassword = request.getParameter(INTERNAL_PASSWORD_PARAMETER);

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

                  public static void decrypt(final PasswordBase password, final AccessControl ac,
                                                   final byte[] data, final Properties passwordProperties)
                      throws IOException, GeneralSecurityException {
                      password.decrypt(ac);
                      String propertiesString = ac.decrypt(data);
              Severity: Minor
              Found in src/main/java/com/enterprisepasswordsafe/engine/utils/PasswordUtils.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

              Method removeEscapeCharacters has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static String removeEscapeCharacters( String original ) {
                      StringBuilder newString = new StringBuilder(original.length());
                      for( int i = 0 ; i < original.length() ; i++) {
                          char thisChar = original.charAt(i);
                          if(thisChar == '\\') {

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

                  @Override
                  Password newInstance(ResultSet rs)
                          throws SQLException {
                      Password password = new Password(rs.getString(1), rs.getBytes(1 + 1));
              
              

              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 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  public void run() {
                      if (!smtpEnabled) {
                          return;
                      }
              Severity: Minor
              Found in src/main/java/com/enterprisepasswordsafe/ui/web/utils/EmailerThread.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

              Avoid too many return statements within this method.
              Open

                          return "group with the id " + variableId;

                Avoid too many return statements within this method.
                Open

                            return ACCESIBILITY_DENIED;
                  Severity
                  Category
                  Status
                  Source
                  Language