Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running jscpd against Vue.js files and template blocks #497

Open
franck-grenier opened this issue Oct 20, 2021 · 3 comments
Open

Running jscpd against Vue.js files and template blocks #497

franck-grenier opened this issue Oct 20, 2021 · 3 comments

Comments

@franck-grenier
Copy link

franck-grenier commented Oct 20, 2021

Hello jscpd,
I'm setting up your great tool on a Vue.js project and I'm getting a lot of clones, some of them not really pertinent in my opinion and my context.

Is-it possible to disable inspection of <template> blocks in .vue files ? While keeping <script> blocks inspected.

That could allow us to focus on JS logic duplications.

Thanks !

@kucherenko
Copy link
Owner

Thank you for the feature request, it should be useful functionality.

@franck-grenier
Copy link
Author

Hello Andrey,
As an example of irrelevant markup duplication report, have a look at the clone below (pure HTML Bootstrap markup) :

    </div>                                                           
</div>                                                               
<footer class="row">                                                 
    <div class="col" />                                              
    <div class="col col-auto mobile-fixed-fullscreen-button d-flex"> 
        <div                                                         
            class="btn hub-btn-outline-medium-grey     

By the way, all clones in my reports, even in <script> part of .vue files, are mentioned as markup :

Clone found (markup):
 - components/Modals/FormEmail2.vue [187:10 - 200:13] (13 lines, 68 tokens)
   components/Modals/FormProfilePicture.vue [233:28 - 246:14]
 187 │ 233 │                                                                                 
 188 │ 234 │                                                                                 
 189 │ 235 │                 this.resolvePromise = async (params) => {                       
 190 │ 236 │                     try {                                                       
 191 │ 237 │                         await callback(params);                                 
 192 │ 238 │                         resolve(params);                                        
 193 │ 239 │                     } catch ({response}) {                                      
 194 │ 240 │                         throw this.formErrors.apiError = response.data.message; 
 195 │ 241 │                     }                                                           
 196 │ 242 │                 };                                                              
 197 │ 243 │                 this.rejectPromise = reject;                                    
 198 │ 244 │             });                                                                 
 199 │ 245 │         },                                                                      
 200 │ 246 │         async validateForm

I guess it's a bug.

I'm running jscpd 3.3.26.

@J3m5
Copy link

J3m5 commented Jan 28, 2024

Hello
That would indeed be very useful.
Has there been any progress in this direction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants