ThibaultMontaufray/Droid-Image

View on GitHub
Project/Droid.Image/Controler/ImageHandler.cs

Summary

Maintainability
D
1 day
Test Coverage

File ImageHandler.cs has 411 lines of code (exceeds 250 allowed). Consider refactoring.
Open

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
Severity: Minor
Found in Project/Droid.Image/Controler/ImageHandler.cs - About 5 hrs to fix

    Method Resize has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            public void Resize(int newWidth, int newHeight)
            {
                if (newWidth != 0 && newHeight != 0)
                {
                    Bitmap temp = (Bitmap)_currentBitmap;
    Severity: Minor
    Found in Project/Droid.Image/Controler/ImageHandler.cs - About 1 hr to fix

      Method InsertText has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              public void InsertText(string text, int xPosition, int yPosition, string fontName, float fontSize, string fontStyle, string colorName1, string colorName2)
              {
                  Bitmap temp = (Bitmap)_currentBitmap;
                  Bitmap bmap = (Bitmap)temp.Clone();
                  Graphics gr = Graphics.FromImage(bmap);
      Severity: Minor
      Found in Project/Droid.Image/Controler/ImageHandler.cs - About 1 hr to fix

        Method SetColorFilter has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                public void SetColorFilter(ColorFilterTypes colorFilterType)
                {
                    Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
                    Color c;
                    for (int i = 0; i < _currentBitmap.Width; i++)
        Severity: Minor
        Found in Project/Droid.Image/Controler/ImageHandler.cs - About 1 hr to fix

          Method SetContrast has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  public void SetContrast(double contrast)
                  {
                      Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
                      if (contrast < -100) contrast = -100;
                      if (contrast > 100) contrast = 100;
          Severity: Minor
          Found in Project/Droid.Image/Controler/ImageHandler.cs - About 1 hr to fix

            Method InsertText has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    public void InsertText(string text, int xPosition, int yPosition, string fontName, float fontSize, string fontStyle, string colorName1, string colorName2)
            Severity: Major
            Found in Project/Droid.Image/Controler/ImageHandler.cs - About 1 hr to fix

              Method SetBrightness has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
              Open

                      public void SetBrightness(int brightness)
                      {
                          Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
                          if (brightness < -255) brightness = -255;
                          if (brightness > 255) brightness = 255;
              Severity: Minor
              Found in Project/Droid.Image/Controler/ImageHandler.cs - About 45 mins to fix

              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 SetContrast has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring.
              Open

                      public void SetContrast(double contrast)
                      {
                          Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
                          if (contrast < -100) contrast = -100;
                          if (contrast > 100) contrast = 100;
              Severity: Minor
              Found in Project/Droid.Image/Controler/ImageHandler.cs - About 45 mins to fix

              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 InsertShape has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      public void InsertShape(string shapeType, int xPosition, int yPosition, int width, int height, string colorName)
              Severity: Minor
              Found in Project/Droid.Image/Controler/ImageHandler.cs - About 45 mins to fix

                There are no issues that match your filters.

                Category
                Status