coding-blocks/CBOnlineApp

View on GitHub
app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginHomeFragment.kt

Summary

Maintainability
C
1 day
Test Coverage

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

    private fun setSecondSpan() {
        val policySpan = SpannableString(
            "By logging in you agree to Coding Blocks’s\n" +
                "Privacy Policy & Terms of Service"
        )

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

        override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
            super.onViewCreated(view, savedInstanceState)
            ccp.registerCarrierNumberEditText(numberedtv)
            ccp.setTypeFace(Typeface.createFromAsset(requireContext().assets, "fonts/gilroy_bold.ttf"))
            setFirstSpan()

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

              val privacySpan: ClickableSpan = object : ClickableSpan() {
                  override fun onClick(textView: View) {
                      requireContext().openChrome("https://codingblocks.com/privacypolicy.html")
                  }
      
      
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginHomeFragment.kt on lines 81..90

      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 134.

      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

              val tosSpan: ClickableSpan = object : ClickableSpan() {
                  override fun onClick(textView: View) {
                      requireContext().openChrome("https://codingblocks.com/tos.html")
                  }
      
      
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginHomeFragment.kt on lines 70..79

      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 134.

      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 26 locations. Consider refactoring.
      Open

          override fun onCreateView(
              inflater: LayoutInflater,
              container: ViewGroup?,
              savedInstanceState: Bundle?
          ): View? = inflater.inflate(R.layout.fragment_login_home, container, false)
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginOtpFragment.kt on lines 27..31
      app/src/main/java/com/codingblocks/cbonlineapp/auth/SignInFragment.kt on lines 18..22
      app/src/main/java/com/codingblocks/cbonlineapp/auth/SignUpFragment.kt on lines 20..24
      app/src/main/java/com/codingblocks/cbonlineapp/auth/SocialLoginFragment.kt on lines 21..25
      app/src/main/java/com/codingblocks/cbonlineapp/course/batches/RunFragment.kt on lines 27..31
      app/src/main/java/com/codingblocks/cbonlineapp/course/checkout/CheckoutFailedFragment.kt on lines 17..21
      app/src/main/java/com/codingblocks/cbonlineapp/course/checkout/CheckoutOrderDetailsFragment.kt on lines 24..25
      app/src/main/java/com/codingblocks/cbonlineapp/course/checkout/CheckoutPaymentFragment.kt on lines 24..25
      app/src/main/java/com/codingblocks/cbonlineapp/course/checkout/CheckoutPersonalDetailsFragment.kt on lines 23..27
      app/src/main/java/com/codingblocks/cbonlineapp/dashboard/doubts/DashboardDoubtsFragment.kt on lines 89..94
      app/src/main/java/com/codingblocks/cbonlineapp/dashboard/explore/DashboardExploreFragment.kt on lines 109..110
      app/src/main/java/com/codingblocks/cbonlineapp/dashboard/home/DashboardHomeFragment.kt on lines 87..91
      app/src/main/java/com/codingblocks/cbonlineapp/dashboard/library/DashboardLibraryFragment.kt on lines 43..47
      app/src/main/java/com/codingblocks/cbonlineapp/dashboard/mycourses/DashboardMyCoursesFragment.kt on lines 55..59
      app/src/main/java/com/codingblocks/cbonlineapp/library/LibraryHomeFragment.kt on lines 18..23
      app/src/main/java/com/codingblocks/cbonlineapp/library/LibraryViewFragment.kt on lines 98..102
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/CourseContentFragment.kt on lines 104..105
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/player/doubts/VideoDoubtFragment.kt on lines 65..66
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/player/notes/VideoNotesFragment.kt on lines 68..69
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/AboutQuizFragment.kt on lines 23..27
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/QuizFragment.kt on lines 42..46
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/QuizResultFragment.kt on lines 33..38
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/info/QuizInfoFragment.kt on lines 18..23
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/content/quiz/submissions/QuizSubmissionsFragment.kt on lines 38..42
      app/src/main/java/com/codingblocks/cbonlineapp/mycourse/library/CourseLibraryFragment.kt on lines 23..28

      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 97.

      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 3 locations. Consider refactoring.
      Open

              createAccTv.apply {
                  text = wordToSpan
                  movementMethod = LinkMovementMethod.getInstance()
                  highlightColor = Color.TRANSPARENT
              }
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginHomeFragment.kt on lines 95..99
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginOtpFragment.kt on lines 83..87

      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 64.

      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 3 locations. Consider refactoring.
      Open

              policyTv.apply {
                  text = policySpan
                  movementMethod = LinkMovementMethod.getInstance()
                  highlightColor = Color.TRANSPARENT
              }
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginHomeFragment.kt on lines 116..120
      app/src/main/java/com/codingblocks/cbonlineapp/auth/LoginOtpFragment.kt on lines 83..87

      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 64.

      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

      There are no issues that match your filters.

      Category
      Status