NotifyMeCI.GUI/Form1.cs
File Form1.cs
has 401 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using NotifyMeCI.Engine.Enums;
using NotifyMeCI.Engine.Events;
using NotifyMeCI.Engine.Repositories.Interfaces;
using NotifyMeCI.Engine.Objects;
using NotifyMeCI.Injector;
Class Form1
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public partial class Form1 : Form
{
#region Repositories
Method UpdateJobsList
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void UpdateJobsList(IList<CIJob> jobs)
{
if (jobs == default(IList<CIJob>) || !jobs.Any())
{
return;
Method UpdateJobGui
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void UpdateJobGui(IList<CIJob> jobs)
{
// Clear the current jobs list
if (JobListView.InvokeRequired)
{
Method AddServerBtn_Click
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void AddServerBtn_Click(object sender, EventArgs e)
{
var errorTitle = "Error Adding New Server";
try
Method ServerTypeDdl_SelectedIndexChanged
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private void ServerTypeDdl_SelectedIndexChanged(object sender, EventArgs e)
{
var serverType = default(CIServerType);
var selectedItem = ServerTypeDdl.SelectedItem;
Method UpdateJobsList
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
Open
private void UpdateJobsList(IList<CIJob> jobs)
{
if (jobs == default(IList<CIJob>) || !jobs.Any())
{
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"