Comments (3)
Try to use language html, not htmlmixed
from jscpd.
With 0.4.1, I get a similar traceback as above when trying to run against js and html templates:
options = {
path: path,
reporter: 'json',
files: [
'**/*.js', '**/*.html'
],
exclude: [
'**/*main.js', '**/*build.js', '**/webspec/**'
],
output: '.cpReport.json'
};
jscpd.prototype.run(options);
--->
Error: Unknown mode: [object Object]
at Object.exports.getMode (node_modules/jscpd/node_modules/codemirror/addon/runmode/runmode.node.js:100:24)
at evalmachine.<anonymous>:19:28
at Object.exports.getMode (node_modules/codemirror/addon/runmode/runmode.node.js:101:10)
at Object.exports.runMode (node_modules/codemirror/addon/runmode/runmode.node.js:106:22)
at TokenizerCodeMirror.tokenize (node_modules/jscpd/src/tokenizer/TokenizerCodeMirror.coffee:41:16)
at TokenizerCodeMirror.tokenize (node_modules/jscpd/src/tokenizer/TokenizerCodeMirror.coffee:1:1)
at Strategy.detect (node_modules/jscpd/src/strategy.coffee:29:47)
at Detector.start (node_modules/jscpd/src/detector.coffee:10:15)
at jscpd.run (node_modules/jscpd/src/jscpd.coffee:105:26)
With languages=html
, no code is found.
jscpd --path src --files "**/*.html" -l 100 --languages=html
...
100.00% (0 lines) duplicated lines out of 0 total lines of code.
With htmlmixed
, I get a slightly different error:
> jscpd --path src --files "**/*.html" -l 100 --languages=htmlmixed
info: jscpd - copy/paste detector for programming source code, developed by Andrey Kucherenko
warn: File src/.cpd.yaml not found in current directory, or it is broken
warn: File src/.cpd.yml not found in current directory, or it is broken
info: Files search time: durationMs=550
info: Scanning 869 files for duplicates...
evalmachine.<anonymous>:54
state.localState = cssMode.startState(htmlMode.indent(state.htmlState, "
^
TypeError: Object [object Object] has no method 'startState'
at Object.html (evalmachine.<anonymous>:54:34)
at Object.token (evalmachine.<anonymous>:101:20)
at Object.exports.runMode (node_modules/jscpd/node_modules/codemirror/addon/runmode/runmode.node.js:171:24)
at TokenizerCodeMirror.tokenize (node_modules/jscpd/src/tokenizer/TokenizerCodeMirror.coffee:66:18)
at TokenizerCodeMirror.tokenize (node_modules/jscpd/src/tokenizer/TokenizerCodeMirror.coffee:3:59)
at Strategy.detect (node_modules/jscpd/src/strategy.coffee:36:23)
at Detector.start (node_modules/jscpd/src/detector.coffee:25:23)
at jscpd.run (node_modules/jscpd/src/jscpd.coffee:129:28)
at Object.<anonymous> (node_modules/jscpd/src/cli/cli.coffee:35:21)
at after (node_modules/jscpd/node_modules/cli/cli.js:1057:18)
from jscpd.
Fixed in 0.5.0
from jscpd.
Related Issues (20)
- npmjs description not accurate
- The tokens field in duplicates is always zero HOT 1
- Adding Purescript as a supported language to jscpd
- "ignore" does not work with relative paths that don't start with a wildcard glob
- consoleFull/html reporter shows wrong code block than line number gives HOT 1
- compare a file with a directory HOT 2
- 查重
- More documentation on building, running, and debugging HOT 1
- Astro Support HOT 2
- Please add ColdFusion / CFML language support HOT 3
- Able to compare two project between them HOT 1
- Readable report with code extract HOT 1
- Sort output with respect to number of duplicate lines detected HOT 3
- PHP Multiline strings causing line number to be reported incorrectly
- Does jscpd support synchronization methods ? HOT 1
- Npm i fails during install through pre-commit hook HOT 6
- Skip files larger than a certain size HOT 1
- CVE-2024-36361 HOT 2
- Arbitrary extensions for plaintext HOT 1
- Windows not showing report HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jscpd.