ConnectOut-sdp/sdp2023

View on GitHub

Showing 7 of 28 total issues

Function sendEventReminders has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    .onCreate((snapshot, context) => {
      const eventData = snapshot.val();
      const eventId = context.params.eventId;

      // Get the time of the event and calculate the times for the reminders
Severity: Minor
Found in functions/index.js - About 1 hr to fix

    Method onCreate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_event_creator);
    
    

      Method updateEventView has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private void updateEventView(Event event,
                                       TextView title,
                                       TextView description,
                                       Button joinBtn,
                                       Button interestedBtn,

        Method editProfileValidation has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static boolean editProfileValidation(EditText nameInput, EditText emailInput, EditText bioInput, RadioButton male, RadioButton female, RadioButton other) {

          Method setUpListAdapter has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public void setUpListAdapter(Function<FirebaseListOptions.Builder<ChatMessage>, FirebaseListOptions.Builder<ChatMessage>> setLayout,
                                           Function<FirebaseListOptions.Builder<ChatMessage>, FirebaseListOptions.Builder<ChatMessage>> setLifecycleOwner,
                                           BiConsumer<View, ChatMessage> populateView,
                                           Consumer<ListAdapter> setAdapter,
                                           String chatId) {
          Severity: Minor
          Found in app/src/main/java/com/sdpteam/connectout/chat/ChatViewModel.java - About 35 mins to fix

            Method onViewCreated has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                @Override
                public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
                    super.onViewCreated(view, savedInstanceState);
            
                    Button ratingEditButton = view.findViewById(R.id.buttonRatingEditProfile);
            Severity: Minor
            Found in app/src/main/java/com/sdpteam/connectout/profile/ProfileFragment.java - About 25 mins 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

            Method generateQRCode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                public static Bitmap generateQRCode(String data) throws IllegalArgumentException {
                    if (data == null || data.isEmpty()) {
                        throw new IllegalArgumentException("Data cannot be null or empty");
                    }
            
            
            Severity: Minor
            Found in app/src/main/java/com/sdpteam/connectout/QrCode/QRcodeGenerator.java - About 25 mins 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

            Severity
            Category
            Status
            Source
            Language