How detailed should one be in writing the referee's report? When writing a referee's report for an editor of a journal, does one always aim and  try to be as brief as possible, saying yes or no to the publication (giving a couple of sentences in support of one's decision regarding the reasons for recommending/rejecting the paper)? Is it ever appropriate for the referee to write about finer details of the work they are reporting on, in their report to the editor?

After doing a fair bit of research to figure out whether to recommend a paper for publication or not, it can still be a hard decision to make. Is it then appropriate to share the finer details with the editor or does one have to make the decision and write only in support of that decision?
When I write a report I try to be as detailed as possible in my response to the authors. This is important as they will need my comments to improve the manuscript, and if the comments are vague they will fail to do so. However, many of the journals I have experience with in my field (life sciences and bioinformatics) ask referees to avoid including comments regarding the suitability for publication in the letter to the authors. For that purpose they provide the score sheet that needs to be filled when submitting the report (at least for journals using electronic systems).

However, those score sheets cannot convey all the information about the impressions of the referee after reading the paper. Therefore, there is always a section with comments to the editors. In this section you should add any relevant information that is not clearly represented in the score sheet. Personally, I always try to add specific comments to the editors. For example, I may have complained in my report about the poor description of the statistical methods. Then I will let know the editor that that is, in my opinion, a mandatory change for the suitability of the manuscript for publication. Finally, when writing my comments to the editor, I try to be as brief as possible (but never just 'yes' or 'no'), so that I do not overwhelm the editor's likely busy inbox with unnecessary comments.

In summary, the comments to the editor should include any information that is not properly represented in the score sheet, cannot go into the response to the authors, and may be relevant for the editor in order to make an appropriate decision on the manuscript.