Showing 106 of 326 total issues
Method speechToText
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
Label createRightLabelLayout(
string title, string bindingProperty = null, NamedSize namedSize = NamedSize.Medium)
{
var color = Color.FromHex(Theme.Current.AboutTextColor);
Method createMascotImage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
RelativeLayout createMascotImage()
{
var relativeLayout = new RelativeLayout();
_mascotTailImage = new CachedImage
Method OnBindingContextChanged
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected override void OnBindingContextChanged()
{
base.OnBindingContextChanged();
if (!(BindingContext is ConceptModel)) {
Method createLoginForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
StackLayout createLoginForm()
{
var mascotImage = createMascotImage();
var entryStyle = getEntryStyle();
var usernameEntry = createUsernameEntry(entryStyle);
Method addResources
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void addResources()
{
var visualState = new VisualState {
Name = "Selected",
Setters = {
Method RegistrationPostAsync
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
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
Open
protected void calendarPositionChangedEvent(CarouselView.FormsPlugin.Abstractions.PositionSelectedEventArgs e)
{
try
{
selectTodayDateWithoutSelectedFlag();
Method createLecturesVisitingPage
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
void createLecturesVisitingPage(VisitingLecturesList statistics)
{
_currentLecturesVisitingMarks = new List<VisitingPageModel>();
LecturesMarks = new List<VisitingPageModel>();
Date = new List<string>();
Method createSummary
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Open
public KeyValuePair<string, HttpStatusCode> GetDemoResponse(AppDemoType type)
{
if (type == AppDemoType.None) {
return GetInvalidResponse();
}
Method createHeaderView
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
StackLayout createHeaderView()
{
var groupsPicker = new GroupsPickerView();
var searchBar = createSearchBar();
var addMarks = createAddMarksButton();
Method getPageToOpen
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
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
Open
void setVisitingLabsStatistics(LabsModel dataLabs, TakedLabs takedLabs)
{
_takedLabs = takedLabs.Labs;
var labsTetsVisitingStatus = takedLabs.ScheduleProtectionLabs?.Select(labs =>
Consider simplifying this complex logical expression. Open
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
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
Open
void setLabsVisiting(StatsStudentModel student, LaboratoryWorksModel labs)
{
if (_statisticsPage == StatsPageEnum.LabsVisiting)
{
if (Servers.Current == Servers.EduCatsAddress)
- 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"