Showing 104 of 319 total issues
Method startResetPassword
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async Task<object> startResetPassword()
{
try
{
if (checkCredentials())
Method loginRequest
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async Task<UserModel> loginRequest()
{
var userLogin = await DataAccess.Login(Username, Password);
if(!AppDemo.Instance.IsDemoAccount && _services.Preferences.Server == Servers.EduCatsAddress)
Method saveMarks
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
Open
private async Task<KeyValuePair<string, HttpStatusCode>> saveMarks()
{
string link = "";
string body = "";
if (_titleOfPage == CrossLocalization.Translate("stats_page_lectures_visiting"))
- Read upRead up
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
File DataAccess.cs
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System.Collections.Generic;
using System.Net;
using System.Threading.Tasks;
using EduCATS.Constants;
using EduCATS.Data.Models;
Method calculateChartData
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
List<double> calculateChartData(StatsStudentModel stats, LabsVisitingList studentsPractStatistics, LabsVisitingList studentTestStatistics, LaboratoryWorksModel currentPractStudentStatistics, LaboratoryWorksModel worksModel)
{
double avgLabs = 0;
double avgTests = 0;
double avgPract = 0;
Class TodayPageViewModel
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class TodayPageViewModel : ViewModel
{
readonly IPlatformServices _services;
readonly double _subjectHeight;
Method setLabsVisiting
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void setLabsVisiting(StatsStudentModel student, LaboratoryWorksModel labs)
{
if (_statisticsPage == StatsPageEnum.LabsVisiting)
{
if (Servers.Current == Servers.EduCatsAddress)
Method getFiles
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async Task getFiles()
{
IEnumerable<FilesPageModel> files = null;
var appDataDirectory = PlatformServices.Device.GetAppDataDirectory();
File ForgotPasswordPageView.cs
has 254 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using EduCATS.Helpers.Forms;
using EduCATS.Helpers.Forms.Styles;
using EduCATS.Pages.ForgotPassword.ViewModels;
using EduCATS.Themes;
using FFImageLoading.Forms;
Method setChartData
has a Cognitive Complexity of 31 (exceeds 20 allowed). Consider refactoring. Open
Open
void setChartData(StatsStudentModel stats, LabsVisitingList studentsPractStatistics, LabsVisitingList studentTestStatistics, List<double> averages = null)
{
try {
double rating = 0;
- Read upRead up
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 saveMarks
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private async Task saveMarks()
{
string body = "";
string link = "";
if (_title == CrossLocalization.Translate("practice_mark"))
File ForgotPasswordPageViewModel.cs
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using EduCATS.Helpers.Forms;
using EduCATS.Helpers.Json;
using EduCATS.Helpers.Logs;
using EduCATS.Networking;
using EduCATS.Networking.AppServices;
File SavePracticeAndLabsPageViewModel.cs
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using EduCATS.Data.Models;
using EduCATS.Helpers.Forms;
using EduCATS.Helpers.Logs;
using EduCATS.Networking;
using EduCATS.Networking.Models.SaveMarks;
File FilesPageViewModel.cs
has 251 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
Method RefreshToken
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public string RefreshToken()
{
Username = DataAccess.Username;
Password = DataAccess.Password;
Consider simplifying this complex logical expression. Open
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] == '-')
Method setChartData
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void setChartData(StatsStudentModel stats, LabsVisitingList studentsPractStatistics, LabsVisitingList studentTestStatistics, List<double> averages = null)
{
try {
double rating = 0;
Method speechToText
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected async Task speechToText()
{
try {
if (Answers == null || string.IsNullOrEmpty(Question)) {
return;
Method setMarks
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void setMarks(StatsStudentModel student, LaboratoryWorksModel labs)
{
if (_statisticsPage == StatsPageEnum.LabsRating)
{
if (Servers.Current == Servers.EduCatsAddress)
Method createLabsMarksPage
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void createLabsMarksPage(LabsVisitingList labsVisitingList)
{
FullNames = new List<string>();
LabsVisitingMarks = new List<StudentsPageModel>();
Date1 = new List<string>();