scribeWiz-team/ScribeWiz

View on GitHub

Showing 50 of 50 total issues

Method onCreateView has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    override fun onCreateView(
        inflater: LayoutInflater,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View {

    Method DrawFriendsGrid has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        /**
         * Creates a grid with a card corresponding to each friend in the provided friends list.
         *
         * @param friendsList A list of names to display on each friend's card
         */

      Method ExpandableCard has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      @Composable
      fun ExpandableCard(title: String, answer: String) {
          var expanded by remember { mutableStateOf(false) }
      
          Card(

        Method exportMusicXMLFile has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                /*
                * This function is called when the export option is selected in the library fragment,
                * it takes the MusicXML file and the context of the activity,
                * will share the file with the user's preferred app
                * returns true on success, false on failure
        Severity: Minor
        Found in app/src/main/java/com/github/scribeWizTeam/scribewiz/util/Export.kt - About 1 hr to fix

          Method startRecording has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              @SuppressLint("Permissions are checked before calling this method", "MissingPermission")
              private fun startRecording() {
                  // Initialize the AudioRecord
                  audioRecorder = AudioRecord(
                      audioSource,

            Method addBadgeToUser has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    /**
                     * Adds the given badge to the provided user.
                     * If no badge is provided, a default test badge will be added
                     * To get the user, LocalContext.current can be used
                     */

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                                              if (!isGuest) {
                                                  // A button for upvoting the submission
                                                  Button(onClick = {
                                                      // Call the upVote method of the submission on upVote click
                                                      if (submission.upVote(userProfile.id))
              app/src/main/java/com/github/scribeWizTeam/scribewiz/activities/ChallengeNotesActivity.kt on lines 116..125

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 95.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                                              if (!isGuest) {
                                                  // A button for downvoting the submission
                                                  Button(onClick = {
                                                      // Call the downVote method of the submission on downVote click
                                                      if (submission.downVote(userProfile.id))
              app/src/main/java/com/github/scribeWizTeam/scribewiz/activities/ChallengeNotesActivity.kt on lines 98..107

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 95.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

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

                      // Helper Function to loop through the input file's XML content until reaching the end of the document and writes the note at the desired location.
                      private fun loopXMLDocument(
                          eventType: Int,
                          parser: XmlPullParser,
                          xmlSerializer: XmlSerializer,
              Severity: Minor
              Found in app/src/main/java/com/github/scribeWizTeam/scribewiz/util/Editor.kt - About 1 hr to fix

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

                    /**
                     * Sets up the home page with the navigation drawer.
                     */
                    private fun goHomePage() {
                        //set the layout

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              } else {
                                  // Default profile picture
                                  Image(
                                      painter = painterResource(id = R.mipmap.ic_launcher_foreground),
                                      contentDescription = "User profile picture",
                  app/src/main/java/com/github/scribeWizTeam/scribewiz/fragments/HomeFragment.kt on lines 100..106

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 91.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          Box(modifier = modifier, contentAlignment = Alignment.Center) {
                              Image(
                                  painter = painterResource(id = R.drawable.challenge),
                                  contentDescription = "Challenges page",
                                  modifier = Modifier.size(40.dp)
                  app/src/main/java/com/github/scribeWizTeam/scribewiz/fragments/ProfilePageFragment.kt on lines 146..153

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 91.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Method onCreateView has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                  Open

                      override fun onCreateView(
                          inflater: LayoutInflater,
                          container: ViewGroup?,
                          savedInstanceState: Bundle?
                      ): View {

                  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

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          private val challengeTest2: ChallengeModel =
                              ChallengeModel(
                                  "2", "test2",
                                  Date(0),
                                  Date(0),
                  app/src/main/java/com/github/scribeWizTeam/scribewiz/models/ChallengeModel.kt on lines 27..34

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 83.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                          private val challengeTest1: ChallengeModel =
                              ChallengeModel(
                                  "1", "test1",
                                  Date(0),
                                  Date(0),
                  app/src/main/java/com/github/scribeWizTeam/scribewiz/models/ChallengeModel.kt on lines 36..43

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 83.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                              eventType: Int,
                              parser: XmlPullParser,
                              xmlSerializer: XmlSerializer,
                              currentNoteLocation: Int,
                              noteLocation: Int,
                  Severity: Minor
                  Found in app/src/main/java/com/github/scribeWizTeam/scribewiz/util/Editor.kt - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                if (eventType == XmlPullParser.START_TAG && parser.name == "duration") {
                                                    // Parse the duration value
                                                    eventType = parser.next()
                                                    // Calculate the quarter note equivalent of the duration
                                                    val noteDuration = parser.text.toDouble() / divisions * 2.0
                    Severity: Major
                    Found in app/src/main/java/com/github/scribeWizTeam/scribewiz/util/Editor.kt - About 45 mins to fix

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  modifier = Modifier
                                      .height(100.dp)
                                      .width(190.dp)
                                      .padding(5.dp),
                      app/src/main/java/com/github/scribeWizTeam/scribewiz/fragments/RecFragment.kt on lines 164..167

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 68.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                  modifier = Modifier
                                      .height(50.dp)
                                      .width(190.dp)
                                      .padding(5.dp),
                      app/src/main/java/com/github/scribeWizTeam/scribewiz/fragments/HomeFragment.kt on lines 112..115

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 68.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Similar blocks of code found in 2 locations. Consider refactoring.
                      Open

                                                      Box(
                                                          Modifier
                                                              .weight(0.5f)
                                                              .fillMaxHeight(),
                                                          contentAlignment = Alignment.CenterEnd
                      app/src/main/java/com/github/scribeWizTeam/scribewiz/fragments/HomeFragment.kt on lines 74..81

                      Duplicated Code

                      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                      Tuning

                      This issue has a mass of 65.

                      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                      Refactorings

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language