Loaded Coder on local dev site to review code independent from http://pareview.sh/pareview/httpgitdrupalorgsandboxdbt1022237027git . Coder review did not report any critical errors, which is a good thing of course. Closing out the issue https://www.drupal.org/node/2314451 for now because that review is far to nit picking at this stage of development. Creating this issue to track cleanup of more minor warnings/errors report by Coder module review.

CommentFileSizeAuthor
#2 bacnet.module_cleanup-2316443-2.patch13.06 KBdbt102

Comments

dbt102’s picture

Coder found 1 projects, 18 files, 25 normal warnings, 464 minor warnings, 0 warnings were flagged to be ignored

Will go thru these file by file to cleanup.

BACNET.MODULE
BACNET-VIEW-ROW-BARGRAPH.TPL.PHP
BACNET-VIEW-ROW-DIAL.TPL.PHP
BACNET-VIEW-ROW-LINEGRAPH.TPL.PHP
BACNET-VIEW-ROW-TEXT.TPL.PHP
BACNET-VIEW-STYLE-TREND.TPL.PHP
BACNET-VIEW-STYLE-VALUEGRAPHIC.TPL.PHP
BACNET-VIEW-STYLE-VALUETEXT.TPL.PHP
BACNET.INSTALL
BACNET.VIEWS.INC
BACNET_PLUGIN_ROW_BARGRAPH.INC
BACNET_PLUGIN_ROW_DIAL.INC
BACNET_PLUGIN_ROW_LINEGRAPH.INC
BACNET_PLUGIN_ROW_TEXT.INC
BACNET_PLUGIN_STYLE_TREND.INC
BACNET_PLUGIN_STYLE_VALUEGRAPHIC.INC
BACNET_PLUGIN_STYLE_VALUETEXT.INC
BACNET/JS/DRUPAL.BACNET.JS

dbt102’s picture

StatusFileSize
new13.06 KB

On bacnet.module

Before cleanup - FOUND 192 ERRORS AND 13 WARNINGS AFFECTING 159 LINES.

After cleanup -- FOUND 6 ERRORS AND 13 WARNINGS AFFECTING 18 LINES

Patch file is attached

  • dbt102 committed 48a23e4 on 7.x-1.x
    Issue #2316443#comment-9043627 by dbt102: Adds in changes for phpcbf...
dbt102’s picture

now going to cleanup BACNET-VIEW-ROW-BARGRAPH.TPL.PHP

Before cleanup codesniffer FOUND 13 ERRORS AFFECTING 8 LINES

After cleanup code sniffer FOUND 6 ERRORS AND 1 WARNING AFFECTING 2 LINES

Committed changes

dbt102’s picture

dbt102’s picture

Cleanup attempted for BACNET-VIEW-ROW-DIAL.TPL.PHP - -> Codesniffer FOUND 6 ERRORS AND 1 WARNING AFFECTING 2 LINES, but none of these were corrected when running phpcbf

Codesniffer ran on BACNET-VIEW-ROW-LINEGRAPH.TPL.PHP and FOUND 13 ERRORS AND 1 WARNING AFFECTING 9 LINES

After running phpcbf code sniffer found FOUND 6 ERRORS AND 1 WARNING AFFECTING 2 LINES

These updates were committed.

  • dbt102 committed 07069df on 7.x-1.x
    Issue #2316443#comment-9043755 by dbt102]: Code cleanup with phpcbf of...
dbt102’s picture

modified: bacnet.install
modified: bacnet.views.inc
modified: bacnet_plugin_row_bargraph.inc
modified: bacnet_plugin_row_dial.inc
modified: bacnet_plugin_row_linegraph.inc
modified: bacnet_plugin_row_text.inc
modified: bacnet_plugin_style_trend.inc
modified: bacnet_plugin_style_valuegraphic.inc
modified: bacnet_plugin_style_valuetext.inc

and committed

  • dbt102 committed abfd819 on 7.x-1.x
    Issue #2316443#comment-9043849 by dbt102: Completed rest of phpcbf...
dbt102’s picture

Status: Active » Closed (fixed)

Closing out the Code cleanup for now because I completed the review and code edits using phpcbf per review comments by @Sachini.

Will create additional tickets for additional code review.

dbt102’s picture

Reopening this issue to rerun codersniffer and log additional efforts to cleanup code.

dbt102’s picture

Took out comments that were used to implement php code to get, cache and parse SOAP data.

dbt102’s picture

Status: Closed (fixed) » Active
dbt102’s picture

Need to rerun code beautify due to all the new features that have been added.

Presently at FOUND 192 ERRORS AND 32 WARNINGS AFFECTING 166 LINES and PHPCBF CAN FIX THE 114 MARKED SNIFF VIOLATIONS AUTOMATICALLY

  • dbt102 committed 570771f on 7.x-1.x
    Issue #2316443#comment-9056631 by dbt102]: PHPCBF fixed  114 MARKED...

  • dbt102 committed 636266f on 7.x-1.x
    Issue #2316443#comment-9056631 by dbt102]: Redid to compare PHPCBF fixed...
dbt102’s picture

Running code sniffer locally from terminal appears to be having memory difficulties of some kind, so the files patched do not seem to being being saved correctly. Try making another commit to watch this more carefully.

After running cbf message corrections is down to FOUND 78 ERRORS AND 32 WARNINGS AFFECTING 83 LINES

dbt102’s picture

Yep, for some reason the preview reviews do not seem to be keeping up with file updates, even though the new git address is used. So ignoring the preview for now, and just focus on local coder review, this time for bacnet.install

FOUND 102 ERRORS AND 4 WARNINGS AFFECTING 99 LINES &

PHPCBF CAN FIX THE 86 MARKED SNIFF VIOLATIONS AUTOMATICALLY

so after fix

FOUND 16 ERRORS AND 5 WARNINGS AFFECTING 16 LINES

  • dbt102 committed d752cd0 on 7.x-1.x
    Issue #2316443#comment-9056785 by dbt102: Updates to bacnet.install...
dbt102’s picture

tkuldeep17's comment's need to be addressed.

1. function bacnet_theme is no longer being used ==> I removed this.

2. you are not using $user variable anywhere ==> I removed this too.

3. use 'drupal_set_message' ==> OK, did this the Drupal way using 'drupal_set_message'

4. correct the php syntax in use of bacnet_node_form ==> I corrected this

5. There are a lot of paraview issues ==> I agree!! I'm working on these slowly but surely so make sure you are using the most recent commit. It seem like pareview does not automatically update to the most recent commit.

  • dbt102 committed a5f4049 on 7.x-1.x
    Issue #2316443 #comment-9057559 by dbt102: More code cleanup to address...
dbt102’s picture

Using Coder module on local dev I was able to cleanup code on the bacnet.module so that Coder output returned "No Problems Found".

  • dbt102 committed e962410 on 7.x-1.x
    Issue #2316443#comment-9059669 by dbt102: Clode cleanup.  Coder now...
dbt102’s picture

Using Coder module on local dev I was able to cleanup code on the bacnet.install so that Codesniffer output was clean.

  • dbt102 committed 8c7e7c0 on 7.x-1.x
    Issue #2316443#comment-9059767 by dbt102: Clode cleanup.  Codsniffer now...
dbt102’s picture

Removed curly braces that were not needed.

  • dbt102 committed 74dc336 on 7.x-1.x
    Issue #2316443 #comment-9059793 by dbt102: Clode cleanup. Removed curly...
dbt102’s picture

Status: Active » Closed (fixed)

As per comment and attached file at https://www.drupal.org/node/2312955#comment-9059829 this issue has been fixed so will mark it as closed for now.

dbt102’s picture

A bit more cleanup added after adding feature request for additional content type fields.

dbt102’s picture

Status: Closed (fixed) » Active

working thru the minor warnings now.

  • dbt102 committed 4fcb804 on 7.x-1.x
    Issue#2316443 #comment-9067409 by dbt102: Cleanup minor warnings in code...
dbt102’s picture

Cleaned up most minor warnings on file bacnet_plugin_row_dial.inc.

  • dbt102 committed 16503b4 on 7.x-1.x
    Issue#2316443 #comment-9067419 by dbt102: Cleanup most minor warnings on...
dbt102’s picture

Cleaned up most minor warnings on file bacnet_plugin_row_linegraph.inc

  • dbt102 committed 45de9bc on 7.x-1.x
    Issue#2316443 #comment-9067441 by dbt102: Cleanup most minor warnings on...
dbt102’s picture

oops...

After making the some of the changes that Coder was asking, which is mind numbing, I thought to check before I got TOOO far into it. Went to views that were working just fine and now I get this

Style BACnet Value as a Graphic requires a row style but the row plugin is invalid.
Style BACnet Value as a Graphic requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.
Style BACnet Trend Data requires a row style but the row plugin is invalid.

Guess I need to back out some of the changes.

dbt102’s picture

Backed the the changes made to the class and uses_fields().

the format it liked is class "bacnet_plugin_row_bargraph" and "function uses_fields()". Coder wanted "BacnetPluginRowBargraph" and "function usesFields()"

dbt102’s picture

Cleaned up most minor warnings on file bacnet_plugin_style_trend.inc .

  • dbt102 committed 27be35a on 7.x-1.x
    Issue#2316443 #comment-9069197 by dbt102: Cleaned up...
dbt102’s picture

Cleaned up most minor warnings on file BACNET_PLUGIN_STYLE_VALUEGRAPHIC.INC .

  • dbt102 committed 14c7094 on 7.x-1.x
    Issue#2316443 #comment-9069497 by dbt102: Cleaned up...
dbt102’s picture

Cleaned up most minor warnings on file BACNET_PLUGIN_STYLE_VALUETEXT.INC

  • dbt102 committed c17df61 on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up...

  • dbt102 committed 2438264 on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up a few remants
    
dbt102’s picture

down to just a few at this pt

Coder found 1 projects, 18 files, 1 normal warnings, 80 minor warnings, 0 warnings were flagged to be ignored

  • dbt102 committed 1fa6f1b on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up a few more remants
    

  • dbt102 committed 2931b12 on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up a few items on...

  • dbt102 committed 475abcc on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up a few items on...

  • dbt102 committed b1dfa44 on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up a few items on...

  • dbt102 committed 626e068 on 7.x-1.x
    Issue#2316443 #comment-9069995 by dbt102: Cleaned up a few items on...
dbt102’s picture

Closing this because I think the only items left are being discussed under the False Positive issue here --> https://www.drupal.org/node/2324941

dbt102’s picture

Status: Active » Closed (fixed)
dbt102’s picture

Status: Closed (fixed) » Active

Opening back up to cleanup more Pareview issues introduced when implementing new features at #2337583: Supporting future BACnet standards

  • dbt102 committed 30b8d6b on 7.x-1.x
    #2316443#comment-9148441 by dbt: More cleanup for Pareview
    

  • dbt102 committed 5482608 on 7.x-1.x
    #2316443#comment-9148441 by dbt: Add unix style line endings
    
dbt102’s picture

Status: Active » Fixed

Adding unix style line endings reduced the number of preview issues down to just one, so closing out this issue again

https://www.drupal.org/node/2312955#comment-9149435

dbt102’s picture

Version: » 7.x-1.0
Status: Fixed » Closed (fixed)