alsutton/enterprisepasswordsafe

View on GitHub

Showing 189 of 206 total issues

Method doPost has 38 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 doGet has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

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

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

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

          Method newInstance has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

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

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

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

              Method doGet has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  @Override
                  protected void doGet(final HttpServletRequest request, final HttpServletResponse response)
                      throws ServletException {
                      try {
                          User remoteUser = 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

              Method runScript has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public void runScript( Map<String,String> parameters, String script ) 
                      throws IOException {
              
                      try (LineNumberReader lnr = new LineNumberReader(new StringReader(script))) {
                          String nextLine;

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

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

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

                  private String determineRecipients(final TamperproofEventLog eventLogEntry)
                          throws SQLException {
                      String recipient = ConfigurationDAO.getValue(ConfigurationOption.SMTP_TO_PROPERTY);
                      String includeUser = ConfigurationDAO.getValue(ConfigurationOption.INCLUDE_USER_ON_AUDIT_EMAIL);
                      if (includeUser != null && includeUser.equalsIgnoreCase("Y")) {

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

                  @Override
                  public void updateSchema(final long schemaID)
                      throws SQLException {
                      if(schemaID >= SchemaVersion.CURRENT_SCHEMA)
                          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 encode has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static String encode(final String data) {
                      int stringLength = data.length();
                      StringBuilder buffer = new StringBuilder(stringLength);
                      boolean lastWasNewline = false;
                      for (int i = 0; i < stringLength; 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 run has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

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

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

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

                  Function parseDate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          parseDate: function(date, format) {
                              var parts = date.split(format.separator),
                                  date = new Date(),
                                  val;
                              date.setHours(0);
                  Severity: Minor
                  Found in src/main/webapp/js/bootstrap-datepicker.js - About 1 hr to fix

                    Method getByIdForTime has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public HistoricalPassword getByIdForTime(final AccessControl ac, final String id, final long dt) throws SQLException {
                            if (id == null) {
                                return null;
                            }
                    
                    

                      Method doEndTag has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public int doEndTag() {
                              try {            
                                  pageContext.getOut().print("<select name=\"" );
                                  pageContext.getOut().print(name);
                                  pageContext.getOut().print("\">");

                        Method migrateLocations has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private void migrateLocations()
                                throws SQLException {
                                Connection conn = BOMFactory.getCurrentConntection();
                                try(PreparedStatement ps = conn.prepareStatement(INSERT_NODE_SQL) ) {
                                    try(Statement stmt = conn.createStatement()) {

                          Method doPost has a Cognitive Complexity of 11 (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 || !csrfToken.equals(request.getSession(true).getAttribute("csrfToken"))) {

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

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