ilyalehchylin/educats-xamarin

View on GitHub

Showing 251 of 326 total issues

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

                    foreach (var practic in fullPractice.Students.Where(v => v.FullName == studentName))
                    {
                        save.studentId = practic.StudentId;
                        save.showForStudent = ShowForStud;
                        save.mark = Mark;
source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SaveSingleStudentMarkPageViewModel.cs on lines 118..129

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

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

                    foreach (var labs in fullMarksLabs.Students.Where(v => v.FullName == studentName))
                    {
                        save.studentId = labs.StudentId;
                        save.showForStudent = ShowForStud;
                        save.mark = Mark;
source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SaveSingleStudentMarkPageViewModel.cs on lines 96..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 132.

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

        double calculateAvgPractMarks(List<PracticialMarks> practicalsMarks)
        {
            if (practicalsMarks == null)
            {
                return 0;
source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs on lines 657..683
source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs on lines 685..707

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

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

        double calculateAvgLabsMarkTest(List<LabMarks> marks)
        {
            if (marks == null)
            {
                return 0;
source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs on lines 596..622
source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs on lines 685..707

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

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

        double calculateAvgLabsMark(IList<StatsMarkModel> marks)
        {
            if (marks == null) {
                return 0;
            }
source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs on lines 596..622
source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs on lines 657..683

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

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 createLabsMarksPage has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        private void createLabsMarksPage(LabsVisitingList labsVisitingList)
        {
            FullNames = new List<string>();
            LabsVisitingMarks = new List<StudentsPageModel>();
            Date1 = new List<string>();

    Method setMarks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            void setMarks(StatsStudentModel student, LaboratoryWorksModel labs)
            {
                if (_statisticsPage == StatsPageEnum.LabsRating)
                {
                    if (Servers.Current == Servers.EduCatsAddress)

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

              Button createFindButton()
              {
                  var findButton = new Button
                  {
                      Text = CrossLocalization.Translate("parental_get_statistics"),
      source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 235..249
      source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 306..320

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

      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

              Button createResetPasswordButton()
              {
                  var chekInButton = new Button
                  {
                      Text = CrossLocalization.Translate("reset_password"),
      source/EduCATS/Pages/Parental/FindGroup/Views/FindGroupPageView.cs on lines 145..160
      source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 306..320

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

      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

              Button createCheckInButton()
              {
                  var chekInButton = new Button
                  {
                      Text = CrossLocalization.Translate("chek_In"),
      source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 235..249
      source/EduCATS/Pages/Parental/FindGroup/Views/FindGroupPageView.cs on lines 145..160

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

      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 createHiddenDetailsView has 40 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              StackLayout createHiddenDetailsView()
              {
                  var avgPractView = createStatisticsView(
                      CrossLocalization.Translate("stats_chart_average_pract"),
                      Color.FromHex(Theme.Current.StatisticsChartPractColor),
      Severity: Minor
      Found in source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs - About 1 hr to fix

        Method getLecturesVisiting has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                async Task getLecturesVisiting()
                {
                    LecturesModel visitingData = new LecturesModel();
        
                    var listLectures = await DataAccess.GetInfoLectures(_currentSubjectId);

          Method changeCalendarSelection has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  void changeCalendarSelection(
                      CalendarViewModel calendarModel,
                      CalendarViewDayModel calendarDayModel,
                      bool selected)
                  {
          Severity: Minor
          Found in source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs - About 1 hr to fix

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

                    CachedImage createShowNewPasswordImage()
                    {
                        var showPasswordImage = new CachedImage
                        {
                            HeightRequest = _showPasswordIconSize,
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 200..216
            source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 343..359
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 181..197
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 212..228

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

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

                    CachedImage createShowConfirmPasswordImage()
                    {
                        var showPasswordImage = new CachedImage
                       {
                            HeightRequest = _showPasswordIconSize,
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 168..184
            source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 343..359
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 181..197
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 212..228

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

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

                    CachedImage createShowPasswordImage()
                    {
                        var showPasswordImage = new CachedImage
                        {
                            HeightRequest = _showPasswordIconSize,
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 168..184
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 200..216
            source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 343..359
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 212..228

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

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

                    CachedImage createShowConfirmPasswordImage()
                    {
                        var showPasswordImage = new CachedImage
                        {
                            HeightRequest = _showPasswordIconSize,
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 168..184
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 200..216
            source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 343..359
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 181..197

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

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

                    CachedImage createShowPasswordImage()
                    {
                        var showPasswordImage = new CachedImage
                        {
                            HeightRequest = _showPasswordIconSize,
            Severity: Major
            Found in source/EduCATS/Pages/Login/Views/LoginPageView.cs and 4 other locations - About 1 hr to fix
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 168..184
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 200..216
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 181..197
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 212..228

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

            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 createSecondInfoBlock has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    Frame createSecondInfoBlock()
                    {
                        var emailLabel = createLabel("email");
                        var emailText = createInfoLabel();
                        emailText.SetBinding(Label.TextProperty, "Email");
            Severity: Minor
            Found in source/EduCATS/Pages/Settings/Profile/Views/ProfilePageView.cs - About 1 hr to fix

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

                      public static Style GetEntryStyle(NamedSize size = NamedSize.Medium, bool bold = false)
                      {
                          return new Style(typeof(Entry)) {
                              Setters = {
                                  getSetter(Entry.FontSizeProperty, FontSizeController.GetSize(size, typeof(Entry))),
              Severity: Major
              Found in source/EduCATS/Helpers/Forms/Styles/AppStyles.cs and 2 other locations - About 1 hr to fix
              source/EduCATS/Helpers/Forms/Styles/AppStyles.cs on lines 19..28
              source/EduCATS/Helpers/Forms/Styles/AppStyles.cs on lines 30..39

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

              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