ilyalehchylin/educats-xamarin

View on GitHub

Showing 106 of 326 total issues

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

    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)

        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

              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

                Method openFile has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        void openFile(object selectedObject)
                        {
                            try {
                                if (AppDemo.Instance.IsDemoAccount) {
                                    PlatformServices.Device.MainThread(
                Severity: Minor
                Found in source/EduCATS/Pages/Files/ViewModels/FilesPageViewModel.cs - About 1 hr to fix

                  Method CheckNameOfUser has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
                  Open

                          public bool CheckNameOfUser(string nameOfUser)
                          {
                              bool name = true;
                              try
                              {

                  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

                  Method calculateChartData has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring.
                  Open

                          List<double> calculateChartData(StatsStudentModel stats, LabsVisitingList studentsPractStatistics, LabsVisitingList studentTestStatistics, LaboratoryWorksModel currentPractStudentStatistics, LaboratoryWorksModel worksModel)
                          {
                              double avgLabs = 0;
                              double avgTests = 0;
                              double avgPract = 0;

                  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

                  Method createChekInForm has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          StackLayout createChekInForm()
                          {
                              var entryStyle = getEntryStyle();
                              var userNameEntry = createUsernameEntry(entryStyle);
                              var passwordEntry = createPasswordGrid(entryStyle);
                  Severity: Minor
                  Found in source/EduCATS/Pages/Registration/Views/RegistrationPageView.cs - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                    if (Servers.Current == Servers.EduCatsAddress)
                                    {
                    
                                        if (worksModel is not null && worksModel.PracticalsMarks.Count == 0 || worksModel is null && averages[2] == 0)
                                        {
                    Severity: Critical
                    Found in source/EduCATS/Pages/Statistics/Base/ViewModels/StatsPageViewModel.cs - About 1 hr to fix

                      Consider simplifying this complex logical expression.
                      Open

                                  if (string.IsNullOrEmpty(UserName) ||
                                      string.IsNullOrEmpty(Password) ||
                                      string.IsNullOrEmpty(ConfirmPassword) ||
                                      string.IsNullOrEmpty(Name) ||
                                      string.IsNullOrEmpty(Surname) ||

                        Method createLabsMarks has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                void createLabsMarks()
                                {
                                    var group = new Label
                                    {
                                        TextColor = Color.FromHex(Theme.Current.StatisticsDetailsTitleColor),

                          Method setDefaultProps has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  void setDefaultProps(Schedule schedule)
                                  {
                                      if (schedule != null)
                                      {
                                          Color = schedule.Color;
                          Severity: Minor
                          Found in source/EduCATS/Pages/Today/Base/Models/SubjectPageModel.cs - About 1 hr to fix

                            Method setPagesList has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    public void setPagesList()
                                    {
                                        if (_isPract && _isLabs)
                                        {
                                            PagesList = new List<StatsPageModel> {

                              Method getData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      async Task getData()
                                      {
                                          try {
                                              switch (_statisticsPage) {
                                                  case StatsPageEnum.LabsRating:

                                Method speechToText has a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring.
                                Open

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

                                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

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

                                        protected async Task openParental()
                                        {
                                            if (string.IsNullOrEmpty(GroupNumber))
                                            {
                                                _service.Dialogs.ShowError(CrossLocalization.Translate("parental_error_empty_group_number"));

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

                                          protected virtual void openPage(object selectedObject)
                                          {
                                              try
                                              {
                                                  if (selectedObject == null || selectedObject.GetType() != typeof(StatsPageModel))
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language