Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7752085
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:42:36+00:00 2026-06-01T11:42:36+00:00

I want integrate CPD (Copy-Paste-Detection) to my iOS project. I read about it here

  • 0

I want integrate CPD (Copy-Paste-Detection) to my iOS project. I read about it here and here.

To automatically determine CopyPaste in the code I’m using bash script:

echo "Checking files in ${SOURCE_ROOT}"
JARS_DIR=${PROJECT_DIR}/CPD
FULL_PATH_TO_CPD_XML_OUTPUT=${PROJECT_DIR}/cpd-output.xml

# Running CPD
java -classpath "${JARS_DIR}/ObjCLanguage-0.0.5-SNAPSHOT.jar:${JARS_DIR}/pmd.jar" net.sourceforge.pmd.cpd.CPD --minimum-tokens 100 --files "${SOURCE_ROOT}" -v --language ObjectiveC --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > "${FULL_PATH_TO_CPD_XML_OUTPUT}"

# Running self :)
${BUILT_PRODUCTS_DIR} -cpd-xml "${FULL_PATH_TO_CPD_XML_OUTPUT}"

That code create cpd-output.xml file. But take me an error at compile time “Command /bin/sh failed with exit code 126”. Here is log copy http://pastebin.com/359k1Wni
I took the code from this example project
Error is going then I comment this string:

${BUILT_PRODUCTS_DIR} -cpd-xml "${FULL_PATH_TO_CPD_XML_OUTPUT}"

I tried to find what ever information about this error, but found only a few of these problems without answers. I’m not know anything about bash scripting. I will be happy with any advice.
Thank you for your attention.

P.S. Author of following the script written:

In order to integrate XCode and the CPD, we will add to the Build
Phases target with the project, Run Script phase, conventionally
consisting of several parts: Actually calling cpd Parsing
cpd-output.xml Output in the “right format”

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:42:37+00:00Added an answer on June 1, 2026 at 11:42 am

    The problem was in the wrong script. I give a revised script, which logs have been added:

    echo "Checking files in ${SOURCE_ROOT}"
    CPD_DIR=${PROJECT_DIR}/CPD
    JARS_DIR=${PROJECT_DIR}/CPD
    FULL_PATH_TO_CPD_XML_OUTPUT=${PROJECT_DIR}/cpd-output.xml
    OBJC_JAR_LIBRARY=${JARS_DIR}/ObjCLanguage-0.0.5-SNAPSHOT.jar
    
    echo [DEBUG] CPD_DIR = ${CPD_DIR}
    echo [DEBUG] JARS_DIR = ${JARS_DIR}
    echo [DEBUG] FULL_PATH_TO_CPD_XML_OUTPUT = ${FULL_PATH_TO_CPD_XML_OUTPUT}
    echo [DEBUG] OBJC_JAR_LIBRARY = ${OBJC_JAR_LIBRARY}
    echo [DEBUG] SOURCE_ROOT = ${SOURCE_ROOT}
    
    # Running CPD
    java -classpath "${OBJC_JAR_LIBRARY}:${JARS_DIR}/pmd.jar" net.sourceforge.pmd.cpd.CPD --minimum-tokens 200 --files "${SOURCE_ROOT}" -v --language ObjectiveC --encoding UTF-8 --format net.sourceforge.pmd.cpd.XMLRenderer > "${FULL_PATH_TO_CPD_XML_OUTPUT}"
    
    CPD_EXECUTABLE="${CPD_DIR}/CPDObjective-C"
    if [ ! -f "${CPD_EXECUTABLE}" ];
    then
    echo "CPD executable file is not found: " ${CPD_EXECUTABLE}
    fi
    echo "Running ${CPD_EXECUTABLE} -cpd-xml ${FULL_PATH_TO_CPD_XML_OUTPUT}"
    "${CPD_EXECUTABLE}" -cpd-xml "${FULL_PATH_TO_CPD_XML_OUTPUT}"
    

    Here is source code of sample Copy-Paste-Detect

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to integrate the RESTful-API in my Qt-Project. I already read the example
I want to integrate analytics into my iOS app to collect statistics about my
I want to integrate one sample code with (for example SampleCode project) my iPhone
I want to integrate some existing Perl code with ASP.NET. I see plenty examples
I want to integrate the zxing source code to my Android application. I have
I want to integrate a full HTML framework (ie HTML/CSS/JavaScript) inside an iOS app
I want to integrate a php code into my application phoneGap(HTML). So, I tried
I want to integrate voice detection in my iPhone app. The iPhone app allow
I want to integrate bar-code scannerin my Android application. I attempted to add the
I want to integrate Zanox feeds in a Django project. Unfortunately there seem to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.