ilyalehchylin/educats-xamarin

View on GitHub

Showing 251 of 326 total issues

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

                foreach (var subGroupStudent in fullVisitingLabs.Students.Where(v => v.SubGroup == selSubGroup))
                {
                    foreach (var stud in subGroupStudent.LabVisitingMark.Where(v => v.ScheduleProtectionLabId == labVisId))
                    {
                        _currentLabsVisitingMarksSubGroup1.Add(new VisitingPageModel(subGroupStudent.FullName,
source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs on lines 447..454

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

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

                foreach (var subGroupStudent in fullVisitingLabs.Students.Where(v => v.SubGroup == selSubGroup))
                {
                    foreach (var stud in subGroupStudent.LabVisitingMark.Where(v => v.ScheduleProtectionLabId == labVisId))
                    {
                        _currentLabsVisitingMarksSubGroup1.Add(new VisitingPageModel(subGroupStudent.FullName,
source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs on lines 416..423

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

using Newtonsoft.Json;

namespace EduCATS.Data.Models
{
    /// <summary>
Severity: Major
Found in source/EduCATS/Data/Models/Files/FileDetailsModel.cs and 2 other locations - About 1 hr to fix
source/EduCATS/Data/Models/Statistics/StatsMarkModel.cs on lines 1..41
source/EduCATS/Data/Models/Testing/Results/TestResultsModel.cs on lines 1..41

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

                        ((nameOfUser[i] >= 'a') && (nameOfUser[i] <= 'z')) || ((nameOfUser[i] >= 'A') && (nameOfUser[i] <= 'Z')) ||
                        ((nameOfUser[i] >= 'а') && (nameOfUser[i] <= 'я')) || ((nameOfUser[i] >= 'А') && (nameOfUser[i] <= 'Я')) ||
source/EduCATS/Pages/Registration/ViewModels/RegistrationPageViewModel.cs on lines 146..147

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

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 (!(((UserName[i] >= 'a') && (UserName[i] <= 'z')) || ((UserName[i] >= 'A') && (UserName[i] <= 'Z'))
                        || ((UserName[i] >= '0') && (UserName[i] <= '9'))
source/EduCATS/Pages/Registration/ViewModels/RegistrationPageViewModel.cs on lines 122..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 94.

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

        protected StatsPageEnum getPageToOpen(string pageString)
        {
            var labsRatingString = CrossLocalization.Translate("stats_page_labs_rating");
            var labsVisitingString = CrossLocalization.Translate("stats_page_labs_visiting");
            var practiseVisitingString = CrossLocalization.Translate("practiсe_visiting");

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

            void moveAnswer(object obj, bool down)
            {
                try {
                    if (obj == null || obj.GetType() != typeof(int)) {
                        return;

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

              async Task getPractMarkAndVisiting()
              {
                  StatsModel stats = new StatsModel();
                  LabsVisitingList statsTest = new LabsVisitingList();
                  statsTest = await DataAccess.GetTestPracticialStatistics(_currentSubjectId, _currentGroupId);

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

                protected virtual async Task<List<StatsStudentModel>> getStatistics()
                {
                    try
                    {
                        if (!AppUserData.IsProfileLoaded)

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

                  void setVisitingLabsStatistics(LabsModel dataLabs, TakedLabs takedLabs)
                  {
                      _takedLabs = takedLabs.Labs;
          
                      var labsTetsVisitingStatus = takedLabs.ScheduleProtectionLabs?.Select(labs =>

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

                    void createView()
                    {
                        var backgroundImage = createBackgroundImage();
                        var forgotPasswordForm = createForgotPasswordForm();
                        var scrollView = new ScrollView
            source/EduCATS/Pages/Parental/FindGroup/Views/FindGroupPageView.cs on lines 43..67
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 54..76

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

                    void createView()
                    {
                        var backgroundImage = createBackgroundImage();
                        var chekInForm = createChekInForm();
                        var scrollView = new ScrollView
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 42..64
            source/EduCATS/Pages/Parental/FindGroup/Views/FindGroupPageView.cs on lines 43..67

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

                    void createViews()
                    {
                        var settingsIcon = createSettingsIcon();
                        var mainLayout = createDataForm();
            
            
            source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 42..64
            source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs on lines 54..76

            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

            Consider simplifying this complex logical expression.
            Open

                                if (!(((NewPassword[i] >= 'a') && (NewPassword[i] <= 'z')) || ((NewPassword[i] >= 'A') && (NewPassword[i] <= 'Z')) || (NewPassword[i] == '_') ||
                                    ((NewPassword[i] >= '0') && NewPassword[i] <= '9')))
                                {
                                    latin_password = false;
                                    break;

              Consider simplifying this complex logical expression.
              Open

                                  if (!(((Password[i] >= 'a') && (Password[i] <= 'z')) || ((Password[i] >= 'A') && (Password[i] <= 'Z')) || (Password[i] == '_') ||
                                      ((Password[i] >= '0') && Password[i] <= '9')))
                                  {
                                      latin_password = false;
                                      break;

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

                            var clockIcon = new CachedImage
                            {
                                HorizontalOptions = LayoutOptions.Start,
                                VerticalOptions = LayoutOptions.CenterAndExpand,
                                Source = Xamarin.Forms.ImageSource.FromFile(Theme.Current.TodayNewsDateIcon),
                source/EduCATS/Pages/Today/Base/Views/ViewCells/NewsPageViewCell.cs on lines 68..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 89.

                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 clockIcon = new CachedImage {
                                HorizontalOptions = LayoutOptions.Start,
                                VerticalOptions = LayoutOptions.CenterAndExpand,
                                Source = Xamarin.Forms.ImageSource.FromFile(Theme.Current.StatisticsCalendarIcon),
                                HeightRequest = _clockIconSize,
                source/EduCATS/Pages/Today/Base/Views/ViewCells/SubjectPageViewCell.cs on lines 23..35

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

                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

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

                            var group = new Label
                            {
                                TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
                                Style = AppStyles.GetLabelStyle(),
                                Font = Font.SystemFontOfSize(NamedSize.Large),
                Severity: Minor
                Found in source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs and 1 other location - About 1 hr to fix
                source/EduCATS/Pages/SaveLabsAndPracticeMarks/ViewModels/SavePracticeAndLabsPageView.cs on lines 76..83

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

                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

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

                            var group = new Label
                            {
                                TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),
                                Style = AppStyles.GetLabelStyle(),
                                Font = Font.SystemFontOfSize(NamedSize.Large),
                source/EduCATS/Pages/SaveMarks/Views/SaveMarksPageView.cs on lines 94..101

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

                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

                Identical blocks of code found in 6 locations. Consider refactoring.
                Open

                        Style getEntryStyle()
                        {
                            var style = AppStyles.GetEntryStyle();
                
                            style.Setters.Add(new Setter
                source/EduCATS/Pages/ForgotPassword/Views/ForgotPasswordPageView.cs on lines 266..283
                source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 375..392
                source/EduCATS/Pages/Parental/FindGroup/Views/FindGroupPageView.cs on lines 162..179
                source/EduCATS/Pages/SaveLabsAndPracticeMarks/Views/SaveSingleStudentMarkPageView.cs on lines 203..220
                source/EduCATS/Pages/Statistics/Marks/Views/ViewCells/VisitingPageViewCell.cs on lines 121..138

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

                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