Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[codechecker errors & warnings] 10 error and 14 warnings #24

Open
mwuttke opened this issue Nov 23, 2023 · 0 comments
Open

[codechecker errors & warnings] 10 error and 14 warnings #24

mwuttke opened this issue Nov 23, 2023 · 0 comments

Comments

@mwuttke
Copy link

mwuttke commented Nov 23, 2023

Hello,
testing the branch Release_4.2 the moodle codechecker is not happy with the following:

local/chunkupload/classes/chunkupload_form_element.php
    #59: ····protected·$_options·=·array('maxbytes'·=>·0,·'accepted_types'·=>·'*');
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #155: ········$PAGE->requires->js_call_amd('local_chunkupload/chunkupload',·'init',·array(
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #299: ········$filerecord·=·array('contextid'·=>·$newcontextid,·'component'·=>·$newcomponent,
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #301: ················'filename'·=>·$record->filename,·'userid'·=>·$record->userid);
    There should be a comma after the last array item in a multi-line array. (NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine)
    #319: ········$DB->delete_records('local_chunkupload_files',·array('id'·=>·$chunkuploadid));
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)

local/chunkupload/classes/local/chunkupload_file.php
    #29: defined('MOODLE_INTERNAL')·||·die();
    Unexpected MOODLE_INTERNAL check. No side effects or multiple artifacts detected. (moodle.Files.MoodleInternal.MoodleInternalNotNeeded)
    #52: ········$record·=·$DB->get_record('local_chunkupload_files',·array('id'·=>·$token));
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #100: }
    File must end with a newline character (Generic.Files.EndFileNewline.NotFound)
local/chunkupload/classes/local/tests/testmform.php
    #57: ················array('maxbytes'·=>·2·*·1024·*·1024,·'accepted_types'·=>·array('.png')));
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #61: }
    File must end with a newline character (Generic.Files.EndFileNewline.NotFound)

local/chunkupload/classes/state_type.php
    #25: defined('MOODLE_INTERNAL')·||·die();
    Unexpected MOODLE_INTERNAL check. No side effects or multiple artifacts detected. (moodle.Files.MoodleInternal.MoodleInternalNotNeeded)

local/chunkupload/classes/task/cleanup_files.php
    #57: ················array('time'·=>·time()·-·$config->state0duration,·'state'·=>·state_type::UNUSED_TOKEN_GENERATED));
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #61: ················'lastmodified·<·:time·AND·state·=·:state',·array('time'·=>·time()·-·$config->state1duration,
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #62: ················'state'·=>·state_type::UPLOAD_STARTED));
    There should be a comma after the last array item in a multi-line array. (NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine)
    #73: ················'lastmodified·<·:time·AND·state·=·:state',·array('time'·=>·time()·-·$config->state2duration,
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #74: ················'state'·=>·state_type::UPLOAD_COMPLETED));
    There should be a comma after the last array item in a multi-line array. (NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine)

local/chunkupload/db/tasks.php
    #29: $tasks·=·array(
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #30: ····array(
    Short array syntax must be used to define arrays (Generic.Arrays.DisallowLongArraySyntax.Found)
    #37: ········'month'·=>·'*'
    There should be a comma after the last array item in a multi-line array. (NormalizedArrays.Arrays.CommaAfterLast.MissingMultiLine)

local/chunkupload/proceedupload_ajax.php
    #124: die(json_encode($response));
    File must end with a newline character (Generic.Files.EndFileNewline.NotFound)

local/chunkupload/startupload_ajax.php
    #115: die(json_encode($response));
    File must end with a newline character (Generic.Files.EndFileNewline.NotFound)

local/chunkupload/tests/behat/behat_local_chunkupload.php
    #55: }
    File must end with a newline character (Generic.Files.EndFileNewline.NotFound)

local/chunkupload/tests/testupload.php
    #54: echo·$OUTPUT->footer();
    File must end with a newline character (Generic.Files.EndFileNewline.NotFound)

Please, can someone of the plugin maintainers have a look at it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant