modules/custom/eml/lib/EmlDataSet.php
Function getCustomUnitMetadata
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
public function getCustomUnitMetadata() {
$nids = FieldHelper::getValues('node', $this->node, 'field_data_sources', 'target_id');
$sources = node_load_multiple($nids);
$custom_units = array();
- 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
Method detectEmlChanges
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function detectEmlChanges($check_unpublished = TRUE) {
if ($check_unpublished && $this->node->status != NODE_PUBLISHED) {
eml_debug("Skipping detectEmlChanges() since node @nid is not published.", array('@nid' => $this->node->nid));
return FALSE;
}
Function detectEmlChanges
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function detectEmlChanges($check_unpublished = TRUE) {
if ($check_unpublished && $this->node->status != NODE_PUBLISHED) {
eml_debug("Skipping detectEmlChanges() since node @nid is not published.", array('@nid' => $this->node->nid));
return FALSE;
}
- 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
Missing function doc comment Open
Open
public function setEmlValidationStatus($status = NULL) {
- Exclude checks
Missing function doc comment Open
Open
public function getCustomUnitMetadata() {
- Exclude checks
Missing function doc comment Open
Open
public static function getInstance($node) {
- Exclude checks
Public method name "EmlDataSet::getPackageIDParts" is not in lowerCamel format Open
Open
public function getPackageIDParts() {
- Exclude checks
Public method name "EmlDataSet::setEMLHash" is not in lowerCamel format Open
Open
public function setEMLHash($hash) {
- Exclude checks
Public method name "EmlDataSet::getDOI" is not in lowerCamel format Open
Open
public function getDOI() {
- Exclude checks
Missing function doc comment Open
Open
public function calculateEMLHash() {
- Exclude checks
Missing function doc comment Open
Open
public function setEMLRevisionID($id) {
- Exclude checks
Missing function doc comment Open
Open
public function __construct($node) {
- Exclude checks
Public method name "EmlDataSet::getEML" is not in lowerCamel format Open
Open
public function getEML($reset = FALSE) {
- Exclude checks
Missing function doc comment Open
Open
public function getNode() {
- Exclude checks
Missing function doc comment Open
Open
public function setEMLHash($hash) {
- Exclude checks
Public method name "EmlDataSet::getPackageID" is not in lowerCamel format Open
Open
public function getPackageID() {
- Exclude checks
Missing function doc comment Open
Open
public function getEMLRevisionID() {
- Exclude checks
Public method name "EmlDataSet::setEMLRevisionID" is not in lowerCamel format Open
Open
public function setEMLRevisionID($id) {
- Exclude checks
Missing function doc comment Open
Open
public function incrementEMLRevisionID() {
- Exclude checks
Return comment indentation must be 3 spaces, found 2 spaces Open
Open
* This takes care of the coding.
- Exclude checks
Doc comment short description must be on a single line, further text should be a separate paragraph Open
Open
* Nov 2017 Added utf8 option to tidy statement at line 80, i.e. $tidy->repairString($xml, $config,'utf8') for   problem.
- Exclude checks
Public method name "EmlDataSet::getEMLHash" is not in lowerCamel format Open
Open
public function getEMLHash() {
- Exclude checks
Space before opening parenthesis of function call prohibited Open
Open
$xml = preg_replace ('/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u', ' ', $xml);
- Exclude checks
Public method name "EmlDataSet::calculateEMLHash" is not in lowerCamel format Open
Open
public function calculateEMLHash() {
- Exclude checks
Missing function doc comment Open
Open
public function saveDOI($doi) {
- Exclude checks
Missing function doc comment Open
Open
public function getPackageIDParts() {
- Exclude checks
Public method name "EmlDataSet::getEMLRevisionID" is not in lowerCamel format Open
Open
public function getEMLRevisionID() {
- Exclude checks
Public method name "EmlDataSet::incrementEMLRevisionID" is not in lowerCamel format Open
Open
public function incrementEMLRevisionID() {
- Exclude checks
Return comment indentation must be 3 spaces, found 2 spaces Open
Open
* Added utf8 encoding to the tidy statment
- Exclude checks
Missing function doc comment Open
Open
public function getEMLHash() {
- Exclude checks
Missing function doc comment Open
Open
public function getDOI() {
- Exclude checks
Public method name "EmlDataSet::saveDOI" is not in lowerCamel format Open
Open
public function saveDOI($doi) {
- Exclude checks