alsutton/enterprisepasswordsafe

View on GitHub

Showing 189 of 206 total issues

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

    public Set<AccessSummary> getSummaries(final AccessControledObject item)
            throws SQLException {
        Set<AccessSummary> summaries = new TreeSet<>();

        Connection conn = BOMFactory.getCurrentConntection();

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

        @Override
        protected void doPost( final HttpServletRequest request, final HttpServletResponse response)
            throws IOException, ServletException {
            User thisUser = SecurityUtils.getRemoteUser(request);
    
    

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

          @Override
          protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
                  throws ServletException, IOException {
      
              try {

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

            @Override
            protected void doGet( final HttpServletRequest request, final HttpServletResponse response)
                throws IOException, ServletException {
        
                User adminUser = SecurityUtils.getRemoteUser(request);

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

              public Set<AccessSummary> getSummaries(final AccessControledObject item)
                      throws SQLException {
                  Set<AccessSummary> summaries = new TreeSet<>();
          
                  try(PreparedStatement uacPS = BOMFactory.getCurrentConntection().prepareStatement(GET_UAC_SUMMARIES_UAC_SQL)) {

            Method doPost has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @Override
                protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
                        throws ServletException, IOException {
                    try {
                        String passwordId = request.getParameter("id");

              Method doPost has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @Override
                  protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
                          throws IOException, ServletException {
                      String csrfToken = request.getParameter("token");
                      if(csrfToken == null

                Method sendUserCreationEmailToUserIfNeccessary has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private void sendUserCreationEmailToUserIfNeccessary(User createdUser, String password)
                            throws SQLException, MessagingException {
                        String usersEmailAddress = createdUser.getEmail();
                        if( usersEmailAddress == null || usersEmailAddress.isEmpty()) {
                            return;

                  Method getCurrentPropertySettings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public Set<ScriptProperties> getCurrentPropertySettings(
                              final HttpServletRequest request,
                              final IntegrationModule module,
                              final IntegrationModuleScript scriptDetails)
                              throws SQLException, ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {

                    Method generate has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public String generate( final int upperCount, final int lowerCount,
                                final int numericCount, int specialCount, int minLength,
                                int maxLength, final String specialChars, boolean startSpecial ) {

                      Method process has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                              @Override
                              public void process(final HierarchyNode node, final Password password) {
                                  if (password == null || password.getPasswordType() == Password.TYPE_PERSONAL) {
                                      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 doPost has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          @Override
                          protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
                                  throws ServletException, IOException {
                              String id = request.getParameter(ID_PARAMETER);
                              PasswordRestrictionDAO prDAO = PasswordRestrictionDAO.getInstance();

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

                          private void checkLoginRestrictions(HttpServletRequest request, User user)
                                  throws GeneralSecurityException, SQLException, UnknownHostException, ServletException, RedirectException {
                              String address = request.getRemoteAddr();
                              String userId = user.getId();
                              List<UserIPZoneRestriction> restrictions = UserIPZoneRestrictionDAO.getInstance().getApplicable(userId, address);

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

                          public static String substituteParameters( final Map<String,String> values, 
                                  final String text ) {
                              
                              String textToModify = text;
                              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 processSelection has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                          private void processSelection(HttpServletRequest request, String action, final HierarchyNode node)
                                  throws SQLException {
                              String[] nodes = request.getParameterValues(BaseServlet.NODE_LIST_PARAMETER);
                              if (nodes == null || nodes.length == 0) {
                                  StringBuilder message = new StringBuilder();

                      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 getEventsForDateRange has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public List<EventsForDay> getEventsForDateRange(final long startDate,
                                  final long endDate, final String userIdLimit, final String itemIdLimit,
                                  final User fetchingUser, final boolean includePersonal,
                                  final boolean validateTamperstamp)

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

                            private boolean needsUpdate(AccessControl adminAc, AccessControl currentAccessControl,
                                                        UserAccessControlDAO accessControlDAO,
                                                        User entity, Password thePassword, String access,
                                                        AccessControlBuilder<UserAccessControl> accessControlBuilder)

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

                              private boolean needsUpdate(AccessControl adminAc, AccessControl currentAccessControl,
                                                          GroupAccessControlDAO accessControlDAO,
                                                          Group entity, Password thePassword, String access,
                                                          AccessControlBuilder<GroupAccessControl> accessControlBuilder)

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

                                private void deleteSpecifiedNodes(User deletingUser, HierarchyNode parent, String[] nodes)
                                        throws GeneralSecurityException, SQLException, IOException {
                                    for (String thisNodeId : nodes) {
                                        if (thisNodeId != null && thisNodeId.startsWith("p_")) {
                                            thisNodeId = hierarchyNodeDAO.getNodeIDForObject(parent.getNodeId(), thisNodeId.substring(2));

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

                                @Override
                                protected void doGet( final HttpServletRequest request, final HttpServletResponse response)
                                    throws IOException, ServletException {
                            
                                    User adminUser = SecurityUtils.getRemoteUser(request);

                            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