The Code Migrate module is designed to assist developers in migrating websites from Drupal 6 to Drupal 7. It carries out a detailed analysis of the code base of the D6 site and outputs:
1. a list of modules involving a content type
2. a list of functions, methods, globals, and constants in a specified folder not found in D7
3. the lower bound of the lines of the code to rewrite for migration
4. a list of modules on the site with their versions
5. a list of modules on the site that have been integrated into D7 core
6. a list of modules implementing D6 hooks
This information can be used to estimate the coding effort for D6 to D7 migration for custom modules and for rewriting modules in D7.

Install the module and set permissions the usual way. Download and unzip the module, put it into your /sites/all/modules/contrib directory.
Enable it and set permissions to 'administer code migrate'.

To use, go to the module's settings at
/admin/settings/code_migrate
and set the directory for analysis. Save the settings. A list of checkboxes with modules to analyze will appear. Check off modules you want to analyze
and Save the settings.

To analyze click the ANALYZE MY CODE or Migrate links. You can also analyze by going to the URL at your site /code_migrate

On a large and/or slow site this may take a while.
If the module times out, consider analyzing fewer modules at a time.

Project:
http://drupal.org/sandbox/krylov/1635422
Git:
http://drupalcode.org/sandbox/krylov/1635422.git
Version:
D 6.x

Reviews of other projects:
https://drupal.org/node/1248326#comment-6231854
http://drupal.org/node/1591870#comment-6239566
http://drupal.org/node/1570804#comment-6239628

Reviews of other projects, round 2:
http://drupal.org/node/1678248#comment-6273574
http://drupal.org/node/1473540#comment-6274106
http://drupal.org/node/1468596#comment-6274794

CommentFileSizeAuthor
#21 drupalcs-result.txt167.49 KBklausi

Comments

rogical’s picture

Status: Needs review » Needs work

Manual review:
--------------------------------------

  1. Branch name should follow Release naming conventions, eg:6.x-1.x
  2. Remove branch 6x-1.1
  3. Add git link as well as the project link
  4. Can you not using capitalized words for descriptions?
  5. Instructions for installation and using is welcome.
krylov’s picture

Thanks for your suggestions, rogical. The branch name is now in Drupal convention. Also, I added the Git link and instructions on use.

krylov’s picture

Issue summary: View changes

1. added 6.x-1.x branch, deleted older branches in Git
2. added Git link
3. added instructions on how to use the module

krylov’s picture

Issue summary: View changes

removed caps

krylov’s picture

Status: Needs work » Needs review
olmeta.david’s picture

Status: Needs review » Needs work

Hi,

You have to correct your code with global recommandation.
You can use the tool in this URL : http://ventral.org/pareview

For example, all comments must be finished by a point, the comments function must specify "Implements" word instead of "Implementation".

Be careful about indentation in for() and if() blocks.
You have to use space for indentation and not tabs (line 44 and 45).

Don't use the t() function for menu item title, the system will add this for you.

Try to let some blank lines between instructions (for example, line 151 to 184).

Regards,

krylov’s picture

Status: Needs review » Needs work

Thanks, David. I removed the t() function and did some reformatting of comments. Good point about tabs. Those are now replaced with 2 spaces. Most modules I remember actually say "implementation". That and line spacing is a matter of taste.

krylov’s picture

Status: Needs work » Needs review
krylov’s picture

Status: Needs work » Needs review

Now I am reading a module that uses "implements", actually.

krylov’s picture

Issue summary: View changes

1. more details on how to set up and use the module

krylov’s picture

Issue tags: +PAreview: review bonus

3 reviews added.

misc’s picture

Assigned: Unassigned » misc

Assigning to me to do a manual review.

misc’s picture

Assigned: misc » Unassigned
Status: Needs review » Needs work

Automatic review: http://ventral.org/pareview/httpgitdrupalorgsandboxkrylov1635422git

Manual review:

Caps
Do not use all caps for texts
Strange variable get
Why are you using variable_get('code_migrate_dir', './sites/all/modules')? Many sites does not use sites/all at all

I can see that this would be quite heavy on memory on sites with al lot of modules, have you done some tests for that? Have you been thinking on using batch api?

krylov’s picture

Hi MiSc,- thanks for your review. I'll do the code changes shortly.

1. The /sites/all/modules is where contrib modules reside by default, at least in my installation of PressFlow.

2. This modules runs for a couple of dozen seconds on an average server with about two hundreds of modules installed. It is meant to be run manually and its use of CPU and memory is appropriate for such a tool. I don't know if you've read the readme file, but basically this is a tool for migrating D6 sites into D7.

misc’s picture

1 - Modules could be installed in other folders, so you should not count on it being in sites/all - it seems what you are looking for is something like: drupal_get_path('module', 'code_migrate'), or?
2 - Couple of dozens of seconds would lead to time outs on many servers - many developers do not develop locally (but they should...). I tried the module locally on a normal drupal 6 built for an customer and got error becuase of maximum execution time, I even tried to raise it to 120 seconds, but still got an timeout. That is why I ask about batch api. And yes I understand the purpose of the module...

Also I would suggest that you add a check all option for the module pageI tested it out, and you should add an option to mark all checkboxes.

krylov’s picture

1. That is why I have this setting. The user can point the module to any directory they wish. However, it defaults to the most common dir to migrate. Pointing to the code_migrate dir would suggest that you want to migrate this module itself.

2. It benchmarks around 60 seconds on 60 modules on my laptop. My suggestion for timeouts is to uncheck some modules (I am going to mention this is README) and run the module in batches with fewer modules at a time. Batch API is a great but I think it's an overkill for this module. The effective solution is simply to run it in batches and combine results.

misc’s picture

Status: Needs work » Reviewed & tested by the community

1 - Ah ok, misunderstand you usage there, but why do you need this one to be a variable then? And how about if you migrate from a profile , like Pressflow to just drupal 7?
2 - 60 modules is not so much on a regular drupal 6 site.

However, this issues should not be something that stops it for being RTBC.

krylov’s picture

1. It pretty much doesn't matter what you start with. The module will go through any code base and point out what's not in D7. This goes for hooks, constants, globals.

2. That is true. I work with about 200 modules. I was able to analyze them in one run by setting the PHP timeout to 300 seconds.

3. I did some code changes and implemented a new feature, but I can't push them to the Drupal repository. The error I get is "Pushing to krylov@git.drupal.org:sandbox/krylov/1635422.git
To krylov@git.drupal.org:sandbox/krylov/1635422.git
! [rejected] 6.x-1.x -> 6.x-1.x (non-fast-forward)
error: failed to push some refs to 'krylov@git.drupal.org:sandbox/krylov/1635422.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details."

Any idea?

krylov’s picture

I resolved the git issue and pushed the code changes.

klausi’s picture

Status: Reviewed & tested by the community » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: http://drupal.org/node/1635464
Project 2: http://drupal.org/node/1556354

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

krylov’s picture

Thank you for the clarification. I am sorry for opening the second application before the first one was promoted to full project. Please keep this application, Code Migrate http://drupal.org/node/1635464, running. It has already been reviewed.

Close the other one,
http://drupal.org/node/1556354

Robin Millette’s picture

swapping...

RTBC as set in #1635464-14: [D7] Code Migrate.

krylov’s picture

Status: Closed (duplicate) » Reviewed & tested by the community

Thanks. Right on.

klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus
StatusFileSize
new167.49 KB

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Review of the 6.x-1.x branch:

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

manual review:

  1. please fix all the coding standard errors.
  2. do not use all upper case sentences on your project page, very hard to read. See also http://drupal.org/node/997024
  3. what are the differences to the coder upgrade module? why can't you incorporate your code into that existing project? Please add a note about that to your project page and README file.
  4. code_migrate.module: do not include PHP files globally if they do not contain hooks. Include them only in functions when you actually need them.
  5. code_migrate_settings(): hook_settings() does not exist. See http://drupal.org/node/1354#forms on how to document forms.
  6. "Implements of hook_perm()." should be "Implements hook_perm()."
  7. "$form['remote_drupal_server']": all variables defined by your module have to prefixed with your module's name to avoid collisions with other modules.
  8. do not use all upper case words, use standard English capitalization in all your user interface strings.
  9. code_migrate_init(): why do you need that? The path is only accessible by authenticated users anyway, so there is no page caching?

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

krylov’s picture

Hi Klausi,- thank you for your further suggestions.
I reset the default branch to 6.x-1.x and deleted the master branch.
1. ran Coder and reformatted
2. corrected
3. this module does not edit code. Its main purpose is to plan a migration. It also does several thing the Coder module doesn't do so far as I know. It finds content type usage in code, lists all modules with versions, lists all hook calls. It also download D7 versions of the site's modules and lists all that are available. All these make it much better suited for a migration assessment. It is also light weight.
4. moved into the function's body (is this to increase speed while bootstrapping?)
5. corrected
6. corrected
7. prefixed with the module's name
8. Used lower case
9. In some cases the permission can be set for an anonymous user as well if the admin want a visitor to use the module's output.

krylov’s picture

Issue summary: View changes

+3 reivews

krylov’s picture

Issue summary: View changes

+review

krylov’s picture

Issue summary: View changes

+review

krylov’s picture

Status: Needs work » Reviewed & tested by the community
Issue tags: +PAreview: review bonus
mitchell’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, krylov!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on irc in #drupal-contribute. So, come hang out and stay involved! Thanks again, and good luck! :)

patrickd’s picture

@Mitchell, you just fixed an application that was RTBC'd by the applicant himself..
please pay more attention on that next time

mitchell’s picture

@patrickd: no, no. I was going off of #14. None the less, I'll join #code-review now to receive my proper chiding if you're available ;)

patrickd’s picture

maybe later ;-)

krylov’s picture

patrickd,- thanks for updating my account and for the links. I'll check them out as well as the irc:)

krylov’s picture

Hi mitchell,-
for some reason I get "access denied" when I go to create new project page. Is this something to do with my account? Thanks!

patrickd’s picture

everyone gets this at the moment, probably site-maintenance.

krylov’s picture

I see, I see.

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

+review

avpaderno’s picture

Title: Code Migrate » [D7] Code Migrate