code cleanup - sonarlint

This commit is contained in:
proddy
2024-10-02 09:02:24 +02:00
parent 465f14a113
commit e5b98dadde
21 changed files with 97 additions and 119 deletions

View File

@@ -58,7 +58,7 @@ void WebAPIService::webAPIService(AsyncWebServerRequest * request) {
void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject input) {
// check if the user has admin privileges (token is included and authorized)
bool is_admin = false;
EMSESP::webSettingsService.read([&](WebSettings & settings) {
EMSESP::webSettingsService.read([&](WebSettings const & settings) {
Authentication authentication = _securityManager->authenticateRequest(request);
is_admin = settings.notoken_api || AuthenticationPredicates::IS_ADMIN(authentication);
});
@@ -94,7 +94,7 @@ void WebAPIService::parse(AsyncWebServerRequest * request, JsonObject input) {
emsesp::EMSESP::system_.refreshHeapMem();
// output json buffer
AsyncJsonResponse * response = new AsyncJsonResponse(false);
auto response = new AsyncJsonResponse(false);
// add more mem if needed - won't be needed in ArduinoJson 7
// while (!response->getSize()) {