modules/custom/deims_d6_migration/migration/DeimsContentDataSetMigration.php
Method __construct
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct(array $arguments) {
$arguments += array(
'description' => '',
'source_connection' => 'drupal6',
'source_version' => 6,
Function getProjectRoles
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getProjectRoles($node, $row) {
$field_values = array();
$roles = array(
'field_dataset_datamanager_ref' => 'data manager',
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Comments may not appear after statements Open
Open
'field_dataset_ext_assoc_ref', // Handled in prepare()
- Exclude checks
Missing function doc comment Open
Open
public function getProjectRoles($node, $row) {
- Exclude checks
Expected one space after the comma, 0 found Open
Open
if(!$connection->schema()->fieldExists('content_type_data_file','field_data_file_data_set_nid')){
- Exclude checks
Expected newline after closing brace Open
Open
}else{
- Exclude checks
Expected 1 space after closing parenthesis; found 0 Open
Open
if(!$connection->schema()->fieldExists('content_type_data_file','field_data_file_data_set_nid')){
- Exclude checks
No space found before comment text; expected "// $this->addFieldMapping('field_keywords', '9');" but found "//$this->addFieldMapping('field_keywords', '9');" Open
Open
//$this->addFieldMapping('field_keywords', '9');
- Exclude checks
Expected 1 space after IF keyword; 0 found Open
Open
if(!$connection->schema()->fieldExists('content_type_data_file','field_data_file_data_set_nid')){
- Exclude checks
Expected 1 blank line after function; 0 found Open
Open
}
- Exclude checks
No space found before comment text; expected "// $this->addFieldMapping('field_core_areas', '1');" but found "//$this->addFieldMapping('field_core_areas', '1');" Open
Open
//$this->addFieldMapping('field_core_areas', '1');
- Exclude checks
Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses Open
Open
//$this->addFieldMapping('field_keywords', '9');
- Exclude checks
Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses Open
Open
// ->sourceMigration('DeimsContentBiblioMigration');
- Exclude checks
Comments may not appear after statements Open
Open
'field_dataset_fieldcrew_ref', // Handled in prepare()
- Exclude checks
Comments may not appear after statements Open
Open
'field_dataset_datamanager_ref', // Handled in prepare()
- Exclude checks
Missing function doc comment Open
Open
public function prepareRow($row) {
- Exclude checks
The closing brace for the class must have an empty line before it Open
Open
}
- Exclude checks
Expected 1 space after ELSE keyword; 0 found Open
Open
}else{
- Exclude checks
Comments may not appear after statements Open
Open
'field_dataset_labcrew_ref', // Handled in prepare()
- Exclude checks
Missing class doc comment Open
Open
class DeimsContentDataSetMigration extends DrupalNode6Migration {
- Exclude checks
If the line declaring an array spans longer than 80 characters, each element should be broken into its own line Open
Open
protected $dependencies = array('DeimsContentDataFile', 'DeimsContentPerson', 'DeimsContentResearchSite');
- Exclude checks
No space found before comment text; expected "// $this->addFieldMapping('field_related_publications', 'field_dataset_biblio_ref')" but found "//$this->addFieldMapping('field_related_publications', 'field_dataset_biblio_ref')" Open
Open
//$this->addFieldMapping('field_related_publications', 'field_dataset_biblio_ref')
- Exclude checks
Missing function doc comment Open
Open
public function __construct(array $arguments) {
- Exclude checks
Inline comments must end in full-stops, exclamation marks, colons, question marks, or closing parentheses Open
Open
//$this->addFieldMapping('field_core_areas', '1');
- Exclude checks
Missing function doc comment Open
Open
public function prepare($node, $row) {
- Exclude checks