A
A
Alex2020-02-12 14:17:37
phpstorm
Alex, 2020-02-12 14:17:37

Why does the IDE complain about duplicate code?

There are some very simple classes in a TypeScript project. All they do so far is take an object in the constructor and write some of its properties into this. PhpStorm highlights the constructors of these classes with the message "Duplicated code fragment (6 lines long)" although the properties they work with are different:

5e43ddf2370e0727134431.png

I even tried to move the two properties to a common parent class, but it didn't work.

Who is the fool in this situation? Me or IDE? Perhaps I should somehow redo the constructors, but I have no idea how.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question