ilyalehchylin/educats-xamarin

View on GitHub

Showing 251 of 326 total issues

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

        public async Task OpenParentalStudentsListStats(IPlatformServices services,
            int pageIndex, int subjectId, List<StatsStudentModel> students, string title) =>
Severity: Minor
Found in source/EduCATS/Helpers/Forms/Pages/AppPages.cs - About 35 mins to fix

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

            public async Task OpenAddSingleMark(string title, string name, LabsVisitingList Marks, TakedLabs prOrLabStat, int sub) =>
    Severity: Minor
    Found in source/EduCATS/Helpers/Forms/Pages/AppPages.cs - About 35 mins to fix

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

                          if (!(NewPassword.Length > 6 && NewPassword.Length < 30))
                          {
                              _services.Dialogs.ShowError(CrossLocalization.Translate("password_length_error"));
                              return Task.FromResult<object>(null);
                          }
      source/EduCATS/Pages/Registration/ViewModels/RegistrationPageViewModel.cs on lines 218..222

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

      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 (!(Password.Length >= 6 && Password.Length <= 30))
                          {
                              _services.Dialogs.ShowError(CrossLocalization.Translate("password_length_error"));
                              return Task.FromResult<object>(null);
                          }
      source/EduCATS/Pages/ForgotPassword/ViewModels/ForgotPasswordPageViewModel.cs on lines 119..123

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

      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

      using Newtonsoft.Json;
      using System;
      using System.Collections.Generic;
      using System.Text;
      
      
      Severity: Minor
      Found in source/EduCATS/Data/Models/User/SecondUserModel.cs and 1 other location - About 35 mins to fix
      source/EduCATS/Data/Models/User/DeleteAccountModel.cs on lines 1..22

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

      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

      using Newtonsoft.Json;
      using System;
      using System.Collections.Generic;
      using System.Text;
      
      
      Severity: Minor
      Found in source/EduCATS/Data/Models/User/DeleteAccountModel.cs and 1 other location - About 35 mins to fix
      source/EduCATS/Data/Models/User/SecondUserModel.cs on lines 1..20

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

      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 saveMarks has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
      Open

              private async Task saveMarks()
              {
                  string body = ""; 
                  string link = "";
                  if (_title == CrossLocalization.Translate("practice_mark"))

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

                  var student = stats?.Students?.SingleOrDefault(
                      s => string.Compare(s.Name?.ToLower(), _currentUserName?.ToLower()) == 0);
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 139..140
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 141..142
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 162..163

      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

      Method getAndSetStatistics has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
      Open

              protected virtual async Task getAndSetStatistics()
              {
                  try
                  {
                      if (CurrentSubject != null)
      Severity: Minor
      Found in source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs - About 35 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

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

      using System;
      using System.Collections.Generic;
      using System.Text;
      
      namespace EduCATS.Networking.Models.SaveMarks
      source/EduCATS/Networking/Models/SaveMarks/Labs/LabsVisitingList.cs on lines 1..20
      source/EduCATS/Networking/Models/SaveMarks/Lectures/SaveMarksCalendarData.cs on lines 1..23

      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

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

                  var markLabel = new Label
                  {
                      VerticalOptions = LayoutOptions.CenterAndExpand,
                      TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
                      Style = AppStyles.GetLabelStyle(),
      source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs on lines 77..83
      source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs on lines 85..91

      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

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

              {
                  var credentials = new TokenCredentials
                  {
                      Username = username,
                      Password = password
      Severity: Minor
      Found in source/EduCATS/Networking/AppServices/AppServices.cs and 1 other location - About 35 mins to fix
      source/EduCATS/Pages/ForgotPassword/ViewModels/ForgotPasswordPageViewModel.cs on lines 194..202

      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

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

              {
                  var newpassword = new ForgotPasswordModel
                  {
                      Password = newPassword,
                      UserName = userName,
      source/EduCATS/Networking/AppServices/AppServices.cs on lines 47..56

      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

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

      using System;
      using System.Collections.Generic;
      using System.Text;
      
      namespace EduCATS.Networking.Models.SaveMarks
      source/EduCATS/Networking/Models/SaveMarks/Labs/LabsVisitingList.cs on lines 1..20
      source/EduCATS/Networking/Models/SaveMarks/Lectures/VisitingLecturesList.cs on lines 1..20

      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

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

      using System;
      using System.Collections.Generic;
      using System.Text;
      
      namespace EduCATS.Networking.Models.SaveMarks
      source/EduCATS/Networking/Models/SaveMarks/Lectures/SaveMarksCalendarData.cs on lines 1..23
      source/EduCATS/Networking/Models/SaveMarks/Lectures/VisitingLecturesList.cs on lines 1..20

      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

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

                  var dateLabel = new Label
                  {
                      VerticalOptions = LayoutOptions.CenterAndExpand,
                      TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
                      Style = AppStyles.GetLabelStyle(),
      source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs on lines 77..83
      source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs on lines 36..42

      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

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

                  var student = stats?.Students?.SingleOrDefault(
                      s => string.Compare(s.Name?.ToLower(), _currentUserName?.ToLower()) == 0);
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 141..142
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 160..161
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 162..163

      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

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

                  var studentTest = statsTest?.Students?.SingleOrDefault(
                      s => string.Compare(s.FullName?.ToLower(), _currentUserName?.ToLower()) == 0);
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 139..140
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 160..161
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 162..163

      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

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

                  var markLabel = new Label
                  {
                      VerticalOptions = LayoutOptions.CenterAndExpand,
                      TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
                      Style = AppStyles.GetLabelStyle(),
      source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs on lines 85..91
      source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs on lines 36..42

      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

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

                  var studentTest = statsTest?.Students?.SingleOrDefault(
                      s => string.Compare(s.FullName?.ToLower(), _currentUserName?.ToLower()) == 0);
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 139..140
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 141..142
      source/EduCATS/Pages/Statistics/Results/ViewModels/StatsResultsPageViewModel.cs on lines 160..161

      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