Showing 80 of 107 total issues
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return prefix + "Undocumented status code: " + status;
Avoid too many return
statements within this method. Open
return prefix + "Invalid token";
Avoid too many return
statements within this method. Open
return list;
Avoid too many return
statements within this method. Open
return prefix + "Invalid payload size";
Avoid too many return
statements within this method. Open
return "APNS: Undocumented response command: " + command;
Avoid too many return
statements within this method. Open
return new WrappedKeystore((KeyStore) keystore);
Avoid too many return
statements within this method. Open
return prefix + "Invalid token size";
Avoid too many return
statements within this method. Open
return prefix + "Invalid topic size";
Avoid too many return
statements within this method. Open
return prefix + "Missing payload";
Avoid too many return
statements within this method. Open
return new ResponsePacket(command, status, identifier);
Avoid too many return
statements within this method. Open
return (InputStream) keystore;
Method runTest
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void runTest(final String[] args) {
final String keystore = args[0];
final String password = args[1];
final String token = args[2];
final boolean production = args.length >= 4 && args[3].equalsIgnoreCase("production");
- Read upRead up
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 readResponsePacketData
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static ResponsePacket readResponsePacketData(final InputStream input) throws IOException {
final int command = input.read();
if (command < 0) {
return null;
}
- Read upRead up
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 combined
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static PushNotificationPayload combined(final String message, final int badge, final String sound) {
if (message == null && badge < 0 && sound == null) {
throw new IllegalArgumentException("Must provide at least one non-null argument");
}
final PushNotificationPayload payload = complex();
- Read upRead up
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 pushSimplePayloadUsingThreads
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static void pushSimplePayloadUsingThreads(final String keystore, final String password, final boolean production, final String token, final boolean simulation, final int devices, final int threads) {
try {
System.out.println("Creating PushNotificationManager and AppleNotificationServer");
final AppleNotificationServer server = new AppleNotificationServerBasicImpl(keystore, password, production);
- Read upRead up
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 getDevice
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public Device getDevice(final String id) throws UnknownDeviceException, NullIdException {
if ((id == null) || (id.trim().equals(""))) {
throw new NullIdException();
} else {
if (this.devices.containsKey(id)) {
- Read upRead up
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 getDevices
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private LinkedList<Device> getDevices(final SSLSocket socket) throws CommunicationException {
// Compute
LinkedList<Device> listDev = null;
try {
- Read upRead up
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 makeGroups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static List<List<?>> makeGroups(final List<?> objects, final int threads) {
final List<List<?>> groups = new ArrayList<>(threads);
final int total = objects.size();
int devicesPerThread = total / threads;
if (total % threads > 0) {
- Read upRead up
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"