Showing 1,140 of 1,140 total issues
Method SetColorAt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void SetColorAt(byte[] imageData, int x, int y, int width, byte[] color, int bytesPerPixel) {
Avoid deeply nested control flow statements. Open
Open
if (stbi__jpeg_decode_block_prog_dc(data, huff_dc[img_comp[n].hd], n) == 0)
return 0;
Method RunCutOutAlgo
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static byte[] RunCutOutAlgo(ImageResult imageRes, int colorThreshold, int trimapKernel, int guidedKernel, double eps, int cutoffValue) {
Method GetColorAt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void GetColorAt(double[] img, int x, int y, int bytesPerPixel, int width, double[] color) {
Method BoxFilter
has a Cognitive Complexity of 23 (exceeds 20 allowed). Consider refactoring. Open
Open
private static byte[] BoxFilter(byte[] img, int width, int height, int radius, int channels) {
var kernalSize = 2 * radius;
if (kernalSize % 2 == 0) kernalSize++;
var hBlur = new byte[img.Length];
var avg = (float)1 / kernalSize;
- 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 stbi__YCbCr_to_RGB_row
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void stbi__YCbCr_to_RGB_row(FakePtr<byte> _out_, FakePtr<byte> y, FakePtr<byte> pcb,
FakePtr<byte> pcr, int count, int step)
Avoid deeply nested control flow statements. Open
Open
for (x = 0; x < img_comp[n].h; ++x)
{
var x2 = i * img_comp[n].h + x;
var y2 = j * img_comp[n].v + y;
var data = new FakePtr<short>(img_comp[n].coeff, 64 * (x2 + y2 * img_comp[n].coeff_w));
Method NewLocalNewsEvent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static News NewLocalNewsEvent(string title, string descr, string url, string urlText, NewsType type = News.NewsType.New, string id = null) {
Method Erosion1D
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static byte[] Erosion1D(byte[] imageData, int width, int height, int bytePerPixel, int kernelSize, bool horizontal) {
Method SetColorAt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void SetColorAt(byte[] imageData, int x, int y, int width, byte[] color, int bytesPerPixel) {
Method GetColorAt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void GetColorAt(byte[] img, int x, int y, int bytesPerPixel, int width, byte[] color) {
Method Solve
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public void Solve(IReadOnlyList<Vector3> inPoints, IReadOnlyList<Vector4> refPoints, Vector3 inCentroid, Vector3 refCentroid, ref Quaternion resultOptimalRotation, int iterationsCount = 9) {
Avoid deeply nested control flow statements. Open
Open
if (!(marker >= 0xd0 && marker <= 0xd7))
return 1;
Method SetColorAt
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static void SetColorAt(double[] imageData, int x, int y, int width, double[] color, int bytesPerPixel) {
Method Dilation1D
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private static byte[] Dilation1D(byte[] imageData, int width, int height, int bytePerPixel, int kernelSize, bool horizontal) {
Avoid deeply nested control flow statements. Open
Open
if (stbi__jpeg_decode_block(data, huff_dc[img_comp[n].hd], huff_ac[ha], fast_ac[ha], n,
dequant[img_comp[n].tq]) == 0)
return 0;
Avoid deeply nested control flow statements. Open
Open
if (x == 255)
{
marker = stbi__get8();
break;
}
Avoid deeply nested control flow statements. Open
Open
for (i = (uint)0; i < img_x; ++i)
{
_out_[0] = y[i];
_out_[1] = coutput[1][i];
_out_[2] = coutput[2][i];
Avoid deeply nested control flow statements. Open
Open
if (--todo <= 0)
{
if (code_bits < 24)
stbi__grow_buffer_unsafe();
if (!(marker >= 0xd0 && marker <= 0xd7))
Avoid deeply nested control flow statements. Open
Open
if (cookies[cookie.name].Count == 0) {
cookies.Remove(cookie.name);
if (saveToCookieFile) { SaveAllCookies(); }
}