声纳规则squid中的误报s2095

时间:2017-04-27 05:04:34

标签: sonarqube sonar-runner

我正在使用声纳java插件3.14和sonarqube服务器5.5,它已经修复了autocloseable资源但仍然声纳正在抛出误报。我们有大约2000个这种类型的误报我怎么能避免它们##

## 示例

try {
                    con = Controller.getConnectionPool().getAutoCommittedConnection(CLASS_ID);
                    da = Controller.getConnectionPool().getDataAccessDriver();
                    ps = SQLHelper.prepareStatement(con, da.getQueryString(DataAccess.Queries.GET_ENT_FORGOTPWD_DETAILS));
                    rs = SQLHelper.executeQuery(con, ps);
                    if (rs.next()) {
                        help_link_enabled = "N".equalsIgnoreCase(rs.getString(2)) ? "no" : "yes";

                        session.setAttribute(HELP_LINK_ENABLED, help_link_enabled);
                        session.setAttribute(VALID_ENT, valid_ent);
                        logger.debug("Need Help link enabled: {}, Valid enterprise: {}", help_link_enabled, valid_ent);

                        // If Need help link is disabled at Enterprise level.
                        if("no".equalsIgnoreCase(help_link_enabled)) {
                            logger.error("Need Help link disabled at Enterprise level.");
                            _req.setAttribute("error", "HELP_DISABLED");
                            return false;
                        }   
                    } else {
                        // invalid enterprise or enterprise is disabled
                        //msg:Invalid enterprise or enterprise is disabled. Please contact the system administrator.
                        logger.error("Invalid enterprise or enterprise is disabled. Please contact the system administrator.");
                        _req.setAttribute("error", "INVALID_ENT");
                        return false;
                    }

                } catch (Exception e) {
                    logger.error("Exception while fetching the enterprise information", e);
                    _req.setAttribute("error", "INVALID_ERROR");
                    return false;

                } finally {
                    SQLHelper.closeResultSet(rs);

0 个答案:

没有答案