alsutton/enterprisepasswordsafe

View on GitHub

Showing 189 of 206 total issues

File bootstrap-datepicker.js has 429 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* =========================================================
 * bootstrap-datepicker.js 
 * http://www.eyecon.ro/bootstrap-datepicker
 * =========================================================
 * Copyright 2012 Stefan Petre
Severity: Minor
Found in src/main/webapp/js/bootstrap-datepicker.js - About 6 hrs to fix

    PasswordBase has 32 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public abstract class PasswordBase
        implements Comparable<PasswordBase>, AccessControledObject {
    
        /**
         * Number of millisecons in a day.
    Severity: Minor
    Found in src/main/java/com/enterprisepasswordsafe/database/PasswordBase.java - About 4 hrs to fix

      Method create has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          void create()
              throws SQLException, UnsupportedEncodingException, GeneralSecurityException {
              AuthenticationSourcesTable.getInstance().create();
              ConfigurationTable.getInstance().create();
              EventLogTable.getInstance().create();

      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

      PasswordRestriction has 30 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class PasswordRestriction
              implements Serializable {
      
          private static final String NO_LIMITS_STRING = "There are no restrictions on the contents of the password.";
      
      

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

        public final class User
            implements Comparable<User>, EntityWithAccessRights, AccessControlDecryptor {
        
            /**
             * The size of the group access key in bits.
        Severity: Minor
        Found in src/main/java/com/enterprisepasswordsafe/database/User.java - About 3 hrs to fix

          File UserDAO.java has 295 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright (c) 2017 Carbon Security Ltd. <opensource@carbonsecurity.co.uk>
           *
           * Permission to use, copy, modify, and distribute this software for any
           * purpose with or without fee is hereby granted, provided that the above
          Severity: Minor
          Found in src/main/java/com/enterprisepasswordsafe/database/UserDAO.java - About 3 hrs to fix

            File HierarchyNodeDAO.java has 277 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright (c) 2017 Carbon Security Ltd. <opensource@carbonsecurity.co.uk>
             *
             * Permission to use, copy, modify, and distribute this software for any
             * purpose with or without fee is hereby granted, provided that the above

              File UpdateAccess.java has 275 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*
               * Copyright (c) 2017 Carbon Security Ltd. <opensource@carbonsecurity.co.uk>
               *
               * Permission to use, copy, modify, and distribute this software for any
               * purpose with or without fee is hereby granted, provided that the above

                Function click has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        click: function(e) {
                            e.stopPropagation();
                            e.preventDefault();
                            var target = $(e.target).closest('span, td, th');
                            if (target.length === 1) {
                Severity: Major
                Found in src/main/webapp/js/bootstrap-datepicker.js - About 2 hrs to fix

                  Method getDefaultPermissionsForNodeIncludingInherited has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public void getDefaultPermissionsForNodeIncludingInherited(final String nodeId,
                                                                                 final Map<String,PasswordPermission> userPermMap,
                                                                                 final Map<String,PasswordPermission> groupPermMap)
                              throws SQLException, GeneralSecurityException {
                          if( nodeId == 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 doGet has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

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

                    public final class HierarchyNodeDAO
                        extends StoredObjectManipulator<HierarchyNode> {
                    
                        /**
                         * The shared root node.

                      Function fill has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              fill: function() {
                                  var d = new Date(this.viewDate),
                                      year = d.getFullYear(),
                                      month = d.getMonth(),
                                      currentDate = this.date.valueOf();
                      Severity: Major
                      Found in src/main/webapp/js/bootstrap-datepicker.js - About 2 hrs to fix

                        Method doEndTag has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                        Open

                            public int doEndTag() {
                                try {
                                    String day;
                                    String month;
                                    String year;

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

                            public void run() {
                                long startTime = System.currentTimeMillis();
                        
                                int searchTextLength = text.length();
                                StringBuilder textHold = new StringBuilder( searchTextLength );

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

                            @Override
                            protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
                                    throws ServletException, IOException {
                                // Check to see if the login screen was a diversion from
                                // the original request.
                        Severity: Minor
                        Found in src/main/java/com/enterprisepasswordsafe/ui/web/servlets/Welcome.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 doGet has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            @Override
                            protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
                                    throws ServletException, IOException {
                                // Check to see if the login screen was a diversion from
                                // the original request.
                        Severity: Major
                        Found in src/main/java/com/enterprisepasswordsafe/ui/web/servlets/Welcome.java - About 2 hrs to fix

                          Function Datepicker has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              var Datepicker = function(element, options){
                                  this.element = $(element);
                                  this.format = DPGlobal.parseFormat(options.format||this.element.data('date-format')||'mm/dd/yyyy');
                                  this.picker = $(DPGlobal.template)
                                                      .appendTo('body')
                          Severity: Major
                          Found in src/main/webapp/js/bootstrap-datepicker.js - About 2 hrs to fix

                            File UserServlet.java has 261 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            /*
                             * Copyright (c) 2017 Carbon Security Ltd. <opensource@carbonsecurity.co.uk>
                             *
                             * Permission to use, copy, modify, and distribute this software for any
                             * purpose with or without fee is hereby granted, provided that the above

                              File EditHierarchy.java has 258 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /*
                               * Copyright (c) 2017 Carbon Security Ltd. <opensource@carbonsecurity.co.uk>
                               *
                               * Permission to use, copy, modify, and distribute this software for any
                               * purpose with or without fee is hereby granted, provided that the above
                                Severity
                                Category
                                Status
                                Source
                                Language