C# Implementation of interface is a treated as code duplicate

Version I’m using is 8.9 LTS

Each c# interface is a treated as code duplicate

Example

public interface IRequestParams
 {
        public int FYE { get; set; }
 }

have report that this is a duplicate

public class Query :IRequestParams
{
            public int FYE { get; set; }
}

Hi David

Welcome to the community :slight_smile: Yes we wouldn’t expect that code to be raised as duplicate unless parameters have been changed. The relevant parameters are described here. Can you check if there any projects settings that are overriding these settings? Either sonar.cpd.cs.minimumtokens or sonar.cpd.cs.minimumLines

Thanks

Tom

Hi, I don’t overload mentioned params, what is strange I only have problem with only one file. The interface is in separate file, for those which are in the same file as code implementation don’t see any duplications.

I also facing the problem If all controller actions are similar with other controllers and it can happens when I use mediator pattern

 public async Task<IActionResult> Delete([FromRoute] DeleteCommand.Command delete)
 {
       await Mediator.Send(delete);
        return NoContent();
  }

I can define this action in some controller file and extend controllers which will have delete actions, but i dont know if a good practice.

Does anyone works on that issues, seems similar were reported

Got same thing

new Service
                    {
                        Name = "Reporting",
                        Url = "https://ww",
                        IconName = "News",
                        Order = 3,
                        Status = EntityStatus.Active,
                        Active = true
                    } ,
                    new Service
                    {
                        Name = "zyx",
                        Url = "https://",
                        IconName = "EngineeringGroup",
                        Order = 3,
                        Active = true
                    } ,

This is 100% duplicate via sonar analyses