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);
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),
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)
{
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");
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(
Method CheckNameOfUser
has a Cognitive Complexity of 27 (exceeds 20 allowed). Consider refactoring. Open
public bool CheckNameOfUser(string nameOfUser)
{
bool name = true;
try
{
- 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 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;
- 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 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);
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)
{
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;
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;
- 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 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))