Showing 106 of 326 total issues
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 275 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;
File LoginPageViewModel.cs
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Threading.Tasks;
using EduCATS.Data;
using EduCATS.Data.Models;
using EduCATS.Data.User;
Class TodayPageViewModel
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class TodayPageViewModel : ViewModel
{
readonly IPlatformServices _services;
readonly double _subjectHeight;
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;
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)
Class TestPassingPageViewModel
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public partial class TestPassingPageViewModel : ViewModel
{
readonly IPlatformServices _services;
readonly DateTime _startedEntireTest;
readonly int _testId;
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 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;
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;
Method createUserLayout
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Frame createUserLayout()
{
var avatar = createAvatar();
var userLabel = createUserLabel();
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 openPage
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
Frame createMainInfoBlock()
{
var surnameLabel = createLabel("surname");
var surnameText = createInfoLabel();
surnameText.SetBinding(Label.TextProperty, "SecondName");
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;