Project/Droid.Image/Controler/ImageHandler.cs
File ImageHandler.cs
has 411 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Drawing.Drawing2D;
Method Resize
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void Resize(int newWidth, int newHeight)
{
if (newWidth != 0 && newHeight != 0)
{
Bitmap temp = (Bitmap)_currentBitmap;
Method InsertText
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
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);
Method SetColorFilter
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void SetColorFilter(ColorFilterTypes colorFilterType)
{
Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
Color c;
for (int i = 0; i < _currentBitmap.Width; i++)
Method SetContrast
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public void SetContrast(double contrast)
{
Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
if (contrast < -100) contrast = -100;
if (contrast > 100) contrast = 100;
Method InsertText
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void InsertText(string text, int xPosition, int yPosition, string fontName, float fontSize, string fontStyle, string colorName1, string colorName2)
Method SetBrightness
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
public void SetBrightness(int brightness)
{
Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
if (brightness < -255) brightness = -255;
if (brightness > 255) brightness = 255;
- 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 SetContrast
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
public void SetContrast(double contrast)
{
Bitmap bmap = new Bitmap(_currentBitmap.Width, _currentBitmap.Height);
if (contrast < -100) contrast = -100;
if (contrast > 100) contrast = 100;
- 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 InsertShape
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void InsertShape(string shapeType, int xPosition, int yPosition, int width, int height, string colorName)