Delving into the code of FengOffice

FengOffice is an open source application for office automation. It’s a good piece of open source software.

For me, it’s best features are nested workspaces and nested tasks.

Nested workspaces help you segment your office into meaningful blocks, with any meaning you see fit. For example I have a Projects workspace and each project of mine gets its own workspace inside Projects. Into a workspace you can add any number of many different items: documents, notes, files, contacts, companies, events, milestones, tasks. Each workspace summarizes all the contained workspaces at any level.

Very surprisingly, I can make task hierarchies (also by means of the intuitive drag and drop interface) but I cannot sort sibling tasks, and FengOffice people are not going to add this functionality by them own.

So I downloaded and installed the FengOffice Community package, and started to delve into the code to understand how to add that functionality by myself.

In the above picture you can appreciate what surprised me even more than the lack of the feature I want to add. The default ZendStudio detects almost 5,000 issues into the FengOffice code.

ZendStudio let me tune what issues I want notified, so I decide to exclude from the build all the ones related to code inside the library folder. The code there belongs to software from third parties.

Also, some JavaScript code makes ZendStudio crash again and again when building the project, so I decide to change some option of the JavaScript preferences pane, and see if it solves the issue. Luckily that is the case: After I turn on Enable JavaScript semantic validation, the building works fine and completes successfully.

Above you see the result of the new build. Hmm, not as good as I hoped. There are only 60 issues less than before excluding the library folder from the build path.

Assignment in condition is an issue I’d like to see notified, but I turn it off.

Above you see the result of the new build. Hmm, not as good as I hoped. There are only 120 issues less than before turning off Assignment in condition.

Undefined local variable is an issue I really don’t care about, so I turn it off.

Above you see the result of the new build. Wow, that’s something! That single option accounted for more than 4,000 issues.

Really, undefined variable is a non-issue in PHP, so I’m glad to see that the number of issues is drastically reduced turning it off.

Nonetheless, there are still 645 issues. That is a huge number. Do I’m the only one watching the code through ZendStudio lenses?


There are 2 errors in FengOffice, and both are issues of the same kind: the implementation of an abstract class is incomplete. I think that that code is not used, but it’s a bit difficult to say with certainty. So, if it’s not used, why is it included in a FengOffice version?


There are 643 significant warnings in FengOffice.

84 warnings are due to a Bad escape sequence issue. If I check the code, I see that ZendStudio is right. All those issues belong to regular expressions that are erroneously double quoted, without double backslashing included escape sequences. This is easy to fix, by converting double to single quotes. How did they get unnoticed until now?

There are many more warnings that I could see if I turned off one issue type after another. I can and will fix all these issues by myself, before delving further into the code. But I’m not going to do it as a lone developer, so I’ll now try to apply for a developer membership of the FengOffice Community package, and see if I get one.


One Reply to “Delving into the code of FengOffice”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.