ilyalehchylin/educats-xamarin

View on GitHub

Showing 106 of 326 total issues

Method speechToText has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        protected async Task speechToText()
        {
            try {
                if (string.IsNullOrEmpty(NewsTitle) && string.IsNullOrEmpty(NewsBody)) {
                    return;

    Method createRightLabelLayout has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            Label createRightLabelLayout(
                string title, string bindingProperty = null, NamedSize namedSize = NamedSize.Medium)
            {
                var color = Color.FromHex(Theme.Current.AboutTextColor);
    
    
    Severity: Minor
    Found in source/EduCATS/Pages/Settings/About/Views/AboutPageView.cs - About 1 hr to fix

      Method createMascotImage has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              RelativeLayout createMascotImage()
              {
                  var relativeLayout = new RelativeLayout();
      
                  _mascotTailImage = new CachedImage
      Severity: Minor
      Found in source/EduCATS/Pages/Login/Views/LoginPageView.cs - About 1 hr to fix

        Method OnBindingContextChanged has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                protected override void OnBindingContextChanged()
                {
                    base.OnBindingContextChanged();
        
                    if (!(BindingContext is ConceptModel)) {
        Severity: Minor
        Found in source/EduCATS/Pages/Eemc/Views/ViewCell/EemcPageViewCell.cs - About 1 hr to fix

          Method createLoginForm has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  StackLayout createLoginForm()
                  {
                      var mascotImage = createMascotImage();
                      var entryStyle = getEntryStyle();
                      var usernameEntry = createUsernameEntry(entryStyle);
          Severity: Minor
          Found in source/EduCATS/Pages/Login/Views/LoginPageView.cs - About 1 hr to fix

            Method addResources has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    void addResources()
                    {
                        var visualState = new VisualState {
                            Name = "Selected",
                            Setters = {

              Method RegistrationPostAsync has 9 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      public async Task<KeyValuePair<string, HttpStatusCode>> RegistrationPostAsync(string username, string name, string surname, string patronymic, string password, string confirmPassword,
                                      int group, int questionId, string answerToSecretQuestion)

                Method calendarPositionChangedEvent has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        protected void calendarPositionChangedEvent(CarouselView.FormsPlugin.Abstractions.PositionSelectedEventArgs e)
                        {
                            try
                            {
                                selectTodayDateWithoutSelectedFlag();
                Severity: Minor
                Found in source/EduCATS/Pages/Today/Base/ViewModels/TodayPageViewModel.cs - About 1 hr to fix

                  Method createLecturesVisitingPage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          void createLecturesVisitingPage(VisitingLecturesList statistics)
                          {
                              _currentLecturesVisitingMarks = new List<VisitingPageModel>();
                              LecturesMarks = new List<VisitingPageModel>();
                              Date = new List<string>();
                  Severity: Minor
                  Found in source/EduCATS/Pages/SaveMarks/ViewModels/SaveMarksPageViewModel.cs - About 1 hr to fix

                    Method createSummary has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            Frame createSummary()
                            {
                                var summaryLabel = new Label
                                {
                                    Style = AppStyles.GetLabelStyle(NamedSize.Large),

                      Method GetDemoResponse has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              public KeyValuePair<string, HttpStatusCode> GetDemoResponse(AppDemoType type)
                              {
                                  if (type == AppDemoType.None) {
                                      return GetInvalidResponse();
                                  }
                      Severity: Minor
                      Found in source/EduCATS/Demo/AppDemo.cs - About 1 hr to fix

                        Method createHeaderView has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                StackLayout createHeaderView()
                                {
                                    var groupsPicker = new GroupsPickerView();
                                    var searchBar = createSearchBar();
                                    var addMarks = createAddMarksButton();
                        Severity: Minor
                        Found in source/EduCATS/Pages/Statistics/Students/Views/StudentsPageView.cs - About 1 hr to fix

                          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 =>

                                    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;

                                        Method setLabsVisiting has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring.
                                        Open

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

                                        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

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language