alsutton/enterprisepasswordsafe

View on GitHub

Showing 189 of 206 total issues

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

    private void validatePasswordFields(final HttpServletRequest request)
        throws EPSUIException, SQLException {
        String password1 = request.getParameter("password1");
        String password2 = request.getParameter("password2");
        if ((password1 == null || password1.isEmpty())

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

    @Override
    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain next) throws 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 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 {
        String id = ServletUtils.getInstance().getParameterValue(request, SharedParameterNames.PASSWORD_ID_PARAMETER);
        String dt = request.getParameter(BaseServlet.DATE_TIME_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 doPost has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    @Override
    protected void doPost(final HttpServletRequest request, final HttpServletResponse response)
            throws ServletException, IOException {
        try {
            String moduleId = (String) 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

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

    private boolean meetsCharacterBasedRequirements(final String password) {
        int special = 0, numeric = 0, upper = 0, lower = 0;

        for (int i = 0; i < password.length(); i++) {
            char thisChar = password.charAt(i);

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

    private String getIPv6String(HttpServletRequest request, String field) {
        String value = request.getParameter(field);

        if(!value.contains("::")) {
            return mergeSections(value);

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 8 (exceeds 5 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

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

    private void applyPermissions(final User remoteUser, final HierarchyNodeDAO hnDAO, final HierarchyNode node,
                                  final Map<String, PasswordPermission> uPerms,
                                  final Map<String, PasswordPermission> gPerms,
                                  final ChangePermissionsAction action)

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

        private void transferSettingToDatabase(final HttpServletRequest request,
                final ConfigurationDAO cDAO, TamperproofEventLogDAO telDAO,
                final User thisUser,  final String parameterName) throws SQLException,
                GeneralSecurityException, UnsupportedEncodingException {
            String value = request.getParameter(parameterName);

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

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

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

          public void updateEncryptionOnKeys(final User user,  final Encrypter encrypter)
              throws SQLException, GeneralSecurityException {
              if (user == null) {
                  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 processResult has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private void processResult(ResultSet rs, List<ExpandedTamperproofEventLogEntry> daysEvents, User fetchingUser,
                                     Group adminGroup, final boolean includePersonal, final boolean validateTamperstamp)

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

            public boolean hasExpiringPasswords(final User user)
                    throws SQLException, GeneralSecurityException, IOException {
                Calendar expiryCal = Calendar.getInstance();
                String warningPeriod = ConfigurationDAO.getValue(ConfigurationOption.DAYS_BEFORE_EXPIRY_TO_WARN);
                if (warningPeriod != null && warningPeriod.length() > 0) {
        Severity: Minor
        Found in src/main/java/com/enterprisepasswordsafe/database/PasswordDAO.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 importFile has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

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

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

              public HierarchyNodeChildren getChildrenValidForUser(final HierarchyNode node, final User theUser, boolean includeEmpty,
                                                                   final Comparator<HierarchyNode> nodeComparator, final Comparator<Password> objectComparator)

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

                  private void submitChildObjectsToExecutor(final ExecutorService service, final HierarchyNodeDAO hnDAO,
                                                            final HierarchyNode node, final User theUser, final NodeObjectAction action) {

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

                    private void fixTimeAt(Calendar date, int hour, int minute, int second, int millisecond) {
                Severity: Minor
                Found in src/main/java/com/enterprisepasswordsafe/ui/web/servlets/ViewEvents.java - About 35 mins to fix

                  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) {
                    Severity
                    Category
                    Status
                    Source
                    Language