MrZaiko/Polysmee

View on GitHub
app/src/main/java/io/github/polysmee/agora/video/Call.java

Summary

Maintainability
B
6 hrs
Test Coverage
D
67%

Method initializeHandler has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    private void initializeHandler() {

        handler = new IRtcEngineEventHandler() {

            @Override
Severity: Minor
Found in app/src/main/java/io/github/polysmee/agora/video/Call.java - About 3 hrs to fix

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

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;
Severity: Minor
Found in app/src/main/java/io/github/polysmee/agora/video/Call.java - About 2 hrs to fix

    Method initializeHandler has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private void initializeHandler() {
    
            handler = new IRtcEngineEventHandler() {
    
                @Override
    Severity: Minor
    Found in app/src/main/java/io/github/polysmee/agora/video/Call.java - About 1 hr to fix

      Method onAudioVolumeIndication has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      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>();
      Severity: Minor
      Found in app/src/main/java/io/github/polysmee/agora/video/Call.java - About 1 hr to fix

      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

      There are no issues that match your filters.

      Category
      Status