MHKiT-Software / MHKiT-MATLAB

MHKiT-MATLAB provides the marine renewable energy (MRE) community tools for data processing, visualization, quality control, resource assessment, and device performance.
https://mhkit-software.github.io/MHKiT/
BSD 3-Clause "New" or "Revised" License
15 stars 23 forks source link

Add Code Compatibility Reporting #112

Closed simmsa closed 2 months ago

simmsa commented 5 months ago

Addressing issue #67.

Use MATLAB's built in analyzeCodeCompatibility function to run a code compatibility report. The output table provides insight into code that is not compatible with newer versions of MATLAB.

This runs the code compatibility report on the entire mhkit directory, and parses output from the code compatibility report. If "Error" is found is the Severity column, exit status 1 is returned.

The information in this output is relevant to core developers, but not for feature developers. Failing the code compatibility analysis should not make the test fail. We plan to add a separate GitHub action capture the output, but this action is mostly for visibility.

Remaining Tasks

As of this PR there are only "Warnings" and "Info" in the code compatibility report. These should be addressed, but that work falls outside the scope of this PR.

Below is the condensed output from this report:

Identifier Severity Documentation Suppression File LineNumber ColumnRange
COLMP Warning Details none mhkit/tidal/graphics/plot_joint_probability_distribution.m 169 10 17
COLMP Warning Details none mhkit/tidal/graphics/plot_rose.m 104 17 24
COLMP Warning Details none mhkit/wave/graphics/plot_matrix.m 38 17 19
DATNM Info Details none mhkit/dolfyn/io/read_rdi.m 626 13 19
DATNM Info Details none mhkit/dolfyn/io/read_rdi.m 635 13 19
DATNM Info Details none mhkit/dolfyn/io/read_rdi.m 648 13 19
DATNM Info Details none mhkit/dolfyn/io/read_rdi.m 680 17 23
DATNM Info Details none mhkit/tests/QC_Test.m 45 24 30
DATNM Info Details none mhkit/tests/QC_Test.m 46 24 30
DATNM Info Details none mhkit/tests/QC_Test.m 71 24 30
DATNM Info Details none mhkit/tests/QC_Test.m 72 24 30
DATNM Info Details none mhkit/tests/QC_Test.m 162 28 34
DATNM Info Details none mhkit/tests/QC_Test.m 162 53 59
DATNM Info Details none mhkit/tests/River_TestIO.m 20 51 57
DATST Info Details none mhkit/dolfyn/io/read_rdi.m 626 21 27
DATST Info Details none mhkit/dolfyn/io/read_rdi.m 635 21 27
DATST Info Details none mhkit/dolfyn/io/read_rdi.m 648 21 27
DATST Info Details none mhkit/dolfyn/io/read_rdi.m 680 25 31
DATST Info Details none mhkit/tests/River_TestIO.m 19 30 36
DATST Info Details none mhkit/tests/River_TestIO.m 20 25 31
DATST Info Details none mhkit/tidal/io/request_noaa_data.m 80 18 24
DATST Info Details none mhkit/tidal/io/request_noaa_data.m 81 20 26
DATST Info Details none mhkit/wave/graphics/plot_compendium.m 36 5 11
DATST Info Details none mhkit/wave/graphics/plot_compendium.m 37 5 11
DISPLAYPROG Info Details none mhkit/tests/runCodeCompatibilityReport.m 11 5 11
GETFMT Info Details none mhkit/tests/Dolfyn_TestIO.m 290 28 35
GETFMT Info Details none mhkit/tests/Dolfyn_Test_Rotate.m 395 28 35
HISTC Info Details none mhkit/dolfyn/io/read_signature.m 1514 22 26
IDISVARLOW Warning Details none mhkit/river/resource/Froude_number.m 28 8 14
LEGPVPAIR Warning Details none mhkit/wave/graphics/plot_chakrabarti.m 71 40 51
VERLESSMATLAB Info Details none mhkit/dolfyn/rotate/tensorproduct_core.m 6 5 15

Details:

COLMP Details (Warning):

DATNM Details (Info):

DATST Details (Info):

DISPLAYPROG Details (Info):

GETFMT Details (Info):

HISTC Details (Info):

IDISVARLOW Details (Warning):

LEGPVPAIR Details (Warning):

VERLESSMATLAB Details (Info):

simmsa commented 3 months ago

@rpauly18, could you take a look at this PR when you have time? It introduces a code compatibility test and action that fails if there are any ERROR level code compatibility issues across the entire codebase. This addition is beneficial because it flags older function usage for contributed code and allows us to address legacy code sections before they cause issues for the end user.