Showing 104 of 319 total issues
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 getAndSetCalendarNotes
has 36 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 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 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 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 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 (string.IsNullOrEmpty(UserName) ||
string.IsNullOrEmpty(Password) ||
string.IsNullOrEmpty(ConfirmPassword) ||
string.IsNullOrEmpty(Name) ||
string.IsNullOrEmpty(Surname) ||
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)
{
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 setPagesList
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void setPagesList()
{
if (_isPract && _isLabs)
{
PagesList = new List<StatsPageModel> {
Method setDefaultProps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
void setDefaultProps(Schedule schedule)
{
if (schedule != null)
{
Color = schedule.Color;
Method createUserLayout
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Frame createUserLayout()
{
var avatar = createAvatar();
var userLabel = createUserLabel();
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))
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 OnBindingContextChanged
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
if (!(BindingContext is ConceptModel)) {
Method addResources
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
void addResources()
{
var visualState = new VisualState {
Name = "Selected",
Setters = {