Commit 6d1b27f1 by Sebastián Katzer

Disable some code smells

parent b93cf65c
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* limitations under the License. * limitations under the License.
*/ */
// codebeat:disable[TOO_MANY_FUNCTIONS]
package de.appplant.cordova.plugin.localnotification; package de.appplant.cordova.plugin.localnotification;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
...@@ -634,3 +636,5 @@ public class LocalNotification extends CordovaPlugin { ...@@ -634,3 +636,5 @@ public class LocalNotification extends CordovaPlugin {
} }
} }
// codebeat:enable[TOO_MANY_FUNCTIONS]
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* limitations under the License. * limitations under the License.
*/ */
// codebeat:disable[TOO_MANY_FUNCTIONS]
package de.appplant.cordova.plugin.notification; package de.appplant.cordova.plugin.notification;
import android.annotation.SuppressLint; import android.annotation.SuppressLint;
...@@ -415,3 +417,5 @@ public final class Manager { ...@@ -415,3 +417,5 @@ public final class Manager {
} }
} }
// codebeat:enable[TOO_MANY_FUNCTIONS]
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* limitations under the License. * limitations under the License.
*/ */
// codebeat:disable[TOO_MANY_FUNCTIONS]
package de.appplant.cordova.plugin.notification; package de.appplant.cordova.plugin.notification;
import android.content.Context; import android.content.Context;
...@@ -677,3 +679,5 @@ public final class Options { ...@@ -677,3 +679,5 @@ public final class Options {
} }
} }
// codebeat:enable[TOO_MANY_FUNCTIONS]
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
* limitations under the License. * limitations under the License.
*/ */
// codebeat:disable[TOO_MANY_FUNCTIONS]
#import "APPLocalNotification.h" #import "APPLocalNotification.h"
#import "APPNotificationContent.h" #import "APPNotificationContent.h"
#import "APPNotificationOptions.h" #import "APPNotificationOptions.h"
...@@ -268,7 +270,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -268,7 +270,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
[self.commandDelegate runInBackground:^{ [self.commandDelegate runInBackground:^{
int code = [command.arguments[0] intValue]; int code = [command.arguments[0] intValue];
APPNotificationType type = NotifcationTypeUnknown; APPNotificationType type = NotifcationTypeUnknown;
switch (code) { switch (code) {
case 0: case 0:
type = NotifcationTypeAll; type = NotifcationTypeAll;
...@@ -280,13 +282,13 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -280,13 +282,13 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
type = NotifcationTypeTriggered; type = NotifcationTypeTriggered;
break; break;
} }
NSArray* ids = [_center getNotificationIdsByType:type]; NSArray* ids = [_center getNotificationIdsByType:type];
CDVPluginResult* result; CDVPluginResult* result;
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsArray:ids]; messageAsArray:ids];
[self.commandDelegate sendPluginResult:result [self.commandDelegate sendPluginResult:result
callbackId:command.callbackId]; callbackId:command.callbackId];
}]; }];
...@@ -330,7 +332,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -330,7 +332,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
APPNotificationType type = NotifcationTypeUnknown; APPNotificationType type = NotifcationTypeUnknown;
NSArray* toasts; NSArray* toasts;
NSArray* ids; NSArray* ids;
switch (code) { switch (code) {
case 0: case 0:
type = NotifcationTypeAll; type = NotifcationTypeAll;
...@@ -346,15 +348,15 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -346,15 +348,15 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
toasts = [_center getNotificationOptionsById:ids]; toasts = [_center getNotificationOptionsById:ids];
break; break;
} }
if (toasts == nil) { if (toasts == nil) {
toasts = [_center getNotificationOptionsByType:type]; toasts = [_center getNotificationOptionsByType:type];
} }
CDVPluginResult* result; CDVPluginResult* result;
result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK result = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK
messageAsArray:toasts]; messageAsArray:toasts];
[self.commandDelegate sendPluginResult:result [self.commandDelegate sendPluginResult:result
callbackId:command.callbackId]; callbackId:command.callbackId];
}]; }];
...@@ -404,7 +406,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -404,7 +406,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
NSArray* actions = [command argumentAtIndex:2]; NSArray* actions = [command argumentAtIndex:2];
UNNotificationCategory* group; UNNotificationCategory* group;
BOOL found; BOOL found;
switch (code) { switch (code) {
case 0: case 0:
group = [APPNotificationCategory parse:actions withId:identifier]; group = [APPNotificationCategory parse:actions withId:identifier];
...@@ -618,7 +620,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -618,7 +620,7 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
CDVPluginResult *result = [CDVPluginResult CDVPluginResult *result = [CDVPluginResult
resultWithStatus:CDVCommandStatus_OK resultWithStatus:CDVCommandStatus_OK
messageAsBool:arg]; messageAsBool:arg];
[self.commandDelegate sendPluginResult:result [self.commandDelegate sendPluginResult:result
callbackId:command.callbackId]; callbackId:command.callbackId];
} }
...@@ -702,3 +704,5 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation ...@@ -702,3 +704,5 @@ UNNotificationPresentationOptions const OptionAlert = UNNotificationPresentation
} }
@end @end
// codebeat:enable[TOO_MANY_FUNCTIONS]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment