OrkestApp/sdp_2023

View on GitHub

Showing 50 of 109 total issues

Method FollowList has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring.
Open

@Composable
fun FollowList(activity: ComponentActivity, viewModel: FollowListViewModel){
    Column {
        Row(
            Modifier
Severity: Minor
Found in app/src/main/java/com/github/orkest/ui/FollowListActivity.kt - 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

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

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        Log.d("HELLO TEST","HELLO")
        var deezerApi = DeezerApiIntegration(deezerApiImplemented())
        var codeValue: String? =""
Severity: Minor
Found in app/src/main/java/com/github/orkest/ui/DeezerWelcomeActivity.kt - About 1 hr to fix

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

        public override fun onCreate(savedInstanceState: Bundle?) {
            super.onCreate(savedInstanceState)
            setContent {
                OrkestTheme {
                    // A surface container using the 'background' color from the theme
    Severity: Minor
    Found in app/src/main/java/com/github/orkest/ui/feed/CreatePost.kt - About 1 hr to fix

      Method getTrackName has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          /**
           * This function is used to get the track name from the Spotify API
           *
           * @param spotifyUri The Spotify song ID
           * @return A CompletableFuture that contains the track name
      Severity: Minor
      Found in app/src/main/java/com/github/orkest/ui/sharing/SharingActivity.kt - About 1 hr to fix

        Method onConfirmListener has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        private fun onConfirmListener(context: Context, error: MutableState<Boolean>, errorMessage: MutableState<String>,
                                      waiting: MutableState<Boolean>, userNotInDb: MutableState<Boolean>,
                                      viewModel: AuthViewModel, auth: FirebaseAuth, navController: NavController){
        Severity: Major
        Found in app/src/main/java/com/github/orkest/ui/authentication/SignIn.kt - About 1 hr to fix

          Method startRecordingVideo has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  context: Context,
                  filenameFormat: String,
                  videoCapture: VideoCapture<Recorder>,
                  outputDirectory: File,
                  executor: Executor,
          Severity: Major
          Found in app/src/main/java/com/github/orkest/ui/Camera/CameraViewModel.kt - About 50 mins to fix

            Method SearchUi has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
            Open

                    /**
                     * @param viewModel use to communicate with the Backend
                     *
                     *This method display the search bar, and support the drawing of the future users that will
                     * be find in the database
            Severity: Minor
            Found in app/src/main/java/com/github/orkest/ui/search/SearchUserView.kt - About 45 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 updateCameraPreview has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                fun updateCameraPreview(cameraProvider: ProcessCameraProvider, lifecycleOwner: LifecycleOwner, preview: Preview, videoCaptureRecorder: VideoCapture<Recorder>, selectedMode: MutableState<Boolean>){
            Severity: Minor
            Found in app/src/main/java/com/github/orkest/ui/Camera/CameraViewModel.kt - About 35 mins to fix

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

              private fun updateUI(user: FirebaseUser?, navController: NavController,
                                   isInDatabase: Boolean, context: Context, viewModel: AuthViewModel
              Severity: Minor
              Found in app/src/main/java/com/github/orkest/ui/authentication/SignIn.kt - About 35 mins to fix

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

                    fun sendNotification(title: String, message: String,
                                                channelId: String, channelName: String, notificationId: Int) {
                Severity: Minor
                Found in app/src/main/java/com/github/orkest/ui/notification/Notification.kt - About 35 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language