codeclimate-duplication icon indicating copy to clipboard operation
codeclimate-duplication copied to clipboard

Ignore PHP namespace statements

Open tillkruss opened this issue 6 years ago • 5 comments

We're seeing hundreds of code duplication warnings for namespace statements.

screen shot 2018-07-20 at 9 08 17 am

#245 didn't include the actual namespace statements and this PR covers the case when there is a space between the namespace and use blocks.

tillkruss avatar Jul 20 '18 16:07 tillkruss

The CircleCI tests are don't seem to be working: https://circleci.com/gh/codeclimate/codeclimate-duplication

Any tips @larkinscott?

tillkruss avatar Jul 20 '18 16:07 tillkruss

Any feedback on this PR @toddmazierski @brynary?

tillkruss avatar Jul 20 '18 16:07 tillkruss

👋 @tillkruss Thanks for the PR! This seems reasonable to me.

Looking into this CI failure now.

larkinscott avatar Jul 20 '18 16:07 larkinscott

@tillkruss Thanks for bringing that CI failure to our attention. This should be fixed now if you rebase on top of master.

larkinscott avatar Jul 20 '18 18:07 larkinscott

@larkinscott I rebased the branch, but now other tests are failing:

rspec ./spec/cc/engine/analyzers/php/main_spec.rb:138 # CC::Engine::Analyzers::Php::Main#run can parse php 7 code
rspec ./spec/cc/engine/analyzers/php/main_spec.rb:93 # CC::Engine::Analyzers::Php::Main#run runs against complex files

Both fail due to:

 expected: > 0
            got:   0

I assume the issue previously was the namespace and my PR eliminates the issue?

tillkruss avatar Jul 20 '18 21:07 tillkruss