Skip to content

REQ: add option to ignore import statements (php) #179

Closed
@Gompje

Description

@Gompje

I'm using code climate on a huge Laravel/AngularJS app. So far I'm impressed with the code quality analysis; it's close to 'what I know already'.

However it would be nice to have an option in the duplication engine that allows certain statements to be exact dupes: the namespace and use statements. I have several events defined, for clarity in separate files atm and they all have the same top lines:

namespace App\Events;
 
use Illuminate\Broadcasting\Channel;
use Illuminate\Queue\SerializesModels;
use Illuminate\Broadcasting\PrivateChannel;

This results in a Identical code found in 10 other locations (mass = 57). I'm only just adding these events, there will be at least 5x more. I prefer to keep them in separate files.
Making the treshold higher would mean not catching does nasty little dupes.

Maybe it's possible to add something like 'ignore namespace and use statements' or a more general 'ignore lines starting with ' or even an 'ignore '.

While I realise that I just can ignore these dupe reports, I don't like the clutter it causes and the fact that I always will have to remember to ignore these. They don't help the overall ratings either - they are important for code confidence for myself, our team and our customers.

Or did I miss something in the docs?

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