scribeWiz-team/ScribeWiz

View on GitHub

Showing 28 of 50 total issues

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
             */

      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

          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

          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

              Method onCreateView has a Cognitive Complexity of 21 (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

              Severity
              Category
              Status
              Source
              Language