app/src/main/java/io/github/polysmee/agora/video/Call.java
Method initializeHandler
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
private void initializeHandler() {
handler = new IRtcEngineEventHandler() {
@Override
- 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
Call
has 22 methods (exceeds 20 allowed). Consider refactoring. Invalid
Invalid
public class Call {
public static final int SUCCESS_CODE = 0;
public static final int ERROR_CODE = -1;
public static final int TIME_CODE_FREQUENCY = 10;
Method initializeHandler
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void initializeHandler() {
handler = new IRtcEngineEventHandler() {
@Override
Method onAudioVolumeIndication
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
@Override
public void onAudioVolumeIndication(AudioVolumeInfo[] speakers, int totalVolume) {
//Check the users who are currently talking and run the command to make them appear as talking
Set<Integer> newUsersInCall = new HashSet<Integer>();
- 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"