ilyalehchylin/educats-xamarin

View on GitHub

Showing 251 of 326 total issues

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

        SearchBar createSearchBar()
        {
            var searchBar = new SearchBar
            {
                Margin = _searchBarMargin,
source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs on lines 97..112

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

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

File FilesPageViewModel.cs has 251 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
Severity: Minor
Found in source/EduCATS/Pages/Files/ViewModels/FilesPageViewModel.cs - About 2 hrs to fix

    File SavePracticeAndLabsPageViewModel.cs has 251 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    using EduCATS.Data.Models;
    using EduCATS.Helpers.Forms;
    using EduCATS.Helpers.Logs;
    using EduCATS.Networking;
    using EduCATS.Networking.Models.SaveMarks;

      Method createUserLayout has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              Frame createUserLayout()
              {
                  var avatar = createAvatar();
                  var userLabel = createUserLabel();
      
      
      Severity: Minor
      Found in source/EduCATS/Pages/Settings/Base/Views/SettingsPageView.cs - About 2 hrs to fix

        Consider simplifying this complex logical expression.
        Open

                            if (!(((UserName[i] >= 'a') && (UserName[i] <= 'z')) || ((UserName[i] >= 'A') && (UserName[i] <= 'Z'))
                                || ((UserName[i] >= '0') && (UserName[i] <= '9'))
                                || (UserName[i] == '_')
                                || (UserName[i] == '.')
                                || (UserName[i] == '-')
        Severity: Critical
        Found in source/EduCATS/Pages/Registration/ViewModels/RegistrationPageViewModel.cs - About 2 hrs to fix

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

                  RoundedListView createRoundedList(View header)
                  {
                      var roundedListView = new RoundedListView(typeof(StatsPageViewCell), header: header)
                      {
                          IsPullToRefreshEnabled = true
          source/EduCATS/Pages/Parental/Statistics/StudentListPage/Views/ParentalStudentPsageView.cs on lines 72..85
          source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs on lines 48..61
          source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs on lines 114..127

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

          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

                  RoundedListView createRoundedListView(View header)
                  {
                      var roundedListView = new RoundedListView(typeof(StudentsPageViewCell), header: header)
                      {
                          IsPullToRefreshEnabled = true
          source/EduCATS/Pages/Parental/Statistics/ChooseSubjectPage/Views/ParentalsStatsPageView.cs on lines 34..47
          source/EduCATS/Pages/Statistics/Base/Views/StatsPageView.cs on lines 48..61
          source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs on lines 114..127

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

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

                  async Task openPage(string title)
                  {
                      try
                      {
                          var serverTitle = CrossLocalization.Translate("settings_server");

            Method createMainInfoBlock has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    Frame createMainInfoBlock()
                    {
                        var surnameLabel = createLabel("surname");
                        var surnameText = createInfoLabel();
                        surnameText.SetBinding(Label.TextProperty, "SecondName");
            Severity: Minor
            Found in source/EduCATS/Pages/Settings/Profile/Views/ProfilePageView.cs - About 1 hr to fix

              Method setChartData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      void setChartData(StatsStudentModel stats, LabsVisitingList studentsPractStatistics, LabsVisitingList studentTestStatistics, List<double> averages = null)
                      {
                          try {
                              double rating = 0;
              
              

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

                        void setToolbar()
                        {
                            var speechToolbar = new ToolbarItem();
                
                            speechToolbar.SetBinding(
                source/EduCATS/Pages/Today/NewsDetails/Views/NewsDetailsPageView.cs on lines 32..50

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

                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

                        void setToolbar()
                        {
                            var speechToolbar = new ToolbarItem();
                
                            speechToolbar.SetBinding(
                source/EduCATS/Pages/Testing/Passing/Views/TestPassingPageView.cs on lines 30..48

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

                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

                        Label createForgotPasswordButton()
                        {
                            var ForgotPasswordButton = new Label
                            {
                                Text = CrossLocalization.Translate("forgot_password"),
                Severity: Major
                Found in source/EduCATS/Pages/Login/Views/LoginPageView.cs and 1 other location - About 1 hr to fix
                source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 284..302

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

                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

                        Label createChekInButton()
                        {
                            var chekInButton = new Label
                            {
                                Text = CrossLocalization.Translate("chek_In"),
                Severity: Major
                Found in source/EduCATS/Pages/Login/Views/LoginPageView.cs and 1 other location - About 1 hr to fix
                source/EduCATS/Pages/Login/Views/LoginPageView.cs on lines 304..322

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

                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

                        protected void subjectChosen(object chosenObject)
                        {
                            try
                            {
                                var id = Convert.ToInt32(chosenObject);
                Severity: Major
                Found in source/EduCATS/Pages/Pickers/SubjectsViewModel.cs and 1 other location - About 1 hr to fix
                source/EduCATS/Pages/Pickers/GroupsViewModel.cs on lines 133..151

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

                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

                        protected void subjectChosen(object chosenObject)
                        {
                            try {
                                var id = Convert.ToInt32(chosenObject);
                
                
                Severity: Major
                Found in source/EduCATS/Pages/Pickers/GroupsViewModel.cs and 1 other location - About 1 hr to fix
                source/EduCATS/Pages/Pickers/SubjectsViewModel.cs on lines 93..116

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

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

                        protected async Task speechToText()
                        {
                            try {
                                if (Answers == null || string.IsNullOrEmpty(Question)) {
                                    return;

                  Method getAndSetCalendarNotes has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          async Task getAndSetCalendarNotes()
                          {
                              if (_services.Preferences.Server == Networking.Servers.EduCatsBntuAddress)
                              {
                                  var calendar = await DataAccess.GetProfileInfoCalendar(_services.Preferences.UserLogin);
                  Severity: Minor
                  Found in source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs - About 1 hr to fix

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

                            public async Task openForgotPassword()
                            {
                                if(Servers.Current == Servers.EduCatsAddress)
                                {
                                    if (_services.Device.CheckConnectivity())
                    Severity: Major
                    Found in source/EduCATS/Pages/Login/ViewModels/LoginPageViewModel.cs and 1 other location - About 1 hr to fix
                    source/EduCATS/Pages/Login/ViewModels/LoginPageViewModel.cs on lines 182..200

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

                    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

                            protected async Task openRegistration()
                            {
                                if (Servers.Current == Servers.EduCatsAddress)
                                {
                                    if (_services.Device.CheckConnectivity())
                    Severity: Major
                    Found in source/EduCATS/Pages/Login/ViewModels/LoginPageViewModel.cs and 1 other location - About 1 hr to fix
                    source/EduCATS/Pages/Login/ViewModels/LoginPageViewModel.cs on lines 162..180

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

                    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