Skip to content

Superfluous threshold override check on overloaded functions #3

@belka-ew

Description

@belka-ew

Problem

Assuming I have overloaded functions with different complexity:

module g.h;

import std.stdio;

void f(char x)
{
}

void f(bool x)
{
    if (x)
    {
        bool y = !x;

        if (y)
        {
            writeln("x, y: true");
        }
        else
        {
            writeln("x: true, y: false");
        }
    }
    else
    {
        bool y = !x;

        if (y)
        {
            writeln("x: false, y: true");
        }
        else
        {
            writeln("x, y: false");
        }
    }
}

The complexity of the empty function is 0, the other one 8.

I have a configuration file as well:

[g.h]
f = 10

Cogito fails with the error code 6:

test.d:5: function f: 0 (this symbol shouldn't be excluded anymore)

Possible solution

If the exclusion rule applies to (excludes) at least one function overload, ignore the others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions