Showing 379 of 6,675 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Internship $i = null, \PHPWS_User $phpwsUser = null, $timestamp = null, WorkflowState $fromState = null, WorkflowState $toState = null, $note = null)
- Create a ticketCreate a ticket
Function __construct
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function __construct(Internship $i = null, \PHPWS_User $phpwsUser = null, $timestamp = null, WorkflowState $fromState = null, WorkflowState $toState = null, $note = null)
{
if(!is_null($i)){
$this->id = 0;
$this->internship_id = $i->getId();
- Read upRead up
- Create a ticketCreate a ticket
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 addJoin
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addJoin($join_type, $join_from, $join_to, $join_on_1 = null, $join_on_2 = null, $ignore_tables = false)
- Create a ticketCreate a ticket
Method addWhere
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addWhere($column, $value = null, $operator = null, $conj = null, $group = null, $join = false)
- Create a ticketCreate a ticket
Function addColumn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
{
/****
* What is this for?
- Read upRead up
- Create a ticketCreate a ticket
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
Function getStudent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getStudent($studentId){
if($studentId === null || $studentId == ''){
throw new \InvalidArgumentException('Missing student ID.');
}
- Read upRead up
- Create a ticketCreate a ticket
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
Function encodeStudents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function encodeStudents(Array $students) {
$studentArray = array();
// If an empty array was given, just return an empty JSON array
if(sizeof($students) === 0){
- Read upRead up
- Create a ticketCreate a ticket
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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(InternSettings $emailSettings, Internship $internship, Term $term, $censusTimestamp, $toUsername, $templateFile)
- Create a ticketCreate a ticket
Function checkRequiredFields
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function checkRequiredFields(Internship $i){
// Course number and subject are required so we can check against the expected insurance list in doNotification()
// NB: Course subject and number are not required for secondary parts of multi-part internships
if(!$i->isSecondaryPart() && $i->getCourseNumber() === null || $i->getCourseNumber() === ''){
throw new MissingDataException("Please enter a course number.");
- Read upRead up
- Create a ticketCreate a ticket
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 addColumn
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
- Create a ticketCreate a ticket
Function requireClasses
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function requireClasses()
{
if ($this->load_class && is_array($this->load_class)) {
foreach ($this->load_class as $files) {
if (!is_array($files)) {
- Read upRead up
- Create a ticketCreate a ticket
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
Function prefixVary
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function prefixVary($sql, $tbl)
{
$repl = true;
$ar = explode("'", $sql);
- Read upRead up
- Create a ticketCreate a ticket
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
Consider simplifying this complex logical expression. Open
if(($this->wfState instanceof WorkflowState\SigAuthReadyState || $this->wfState instanceof WorkflowState\SigAuthApprovedState || $this->wfState instanceof WorkflowState\DeanApprovedState || $this->wfState instanceof WorkflowState\RegisteredState) && ($conAffil['value'] == 'No') && (!$this->intern->isSecondaryPart())) {
\NQ::simple('intern', UI\NotifyUI::WARNING, "No contract has been uploaded or affiliation agreement selected. Usually a copy of the signed contract should be uploaded or an affiliation agreement selected.");
}
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(Internship $i, $name, $relation, $phone, $email)
- Create a ticketCreate a ticket
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct(InternSettings $emailSettings, Internship $internship, Term $term, $backgroundCheck, $drugCheck) {
- Create a ticketCreate a ticket
Method addWhere
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addWhere($column, $value, $operator=null, $conj=null, $group=null)
- Create a ticketCreate a ticket
Method _getJoinOn
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _getJoinOn($join_on_1, $join_on_2, $table1, $table2, $ignore_tables = false)
- Create a ticketCreate a ticket
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
// Warning notification for invalid Banner size or Banner ID
var notification = <div className="alert alert-warning" role="alert">{this.state.errorWarning !== '' ? this.state.errorWarning: this.props.errorWarning}</div>
// Search bar for inputting the Banner ID
- Read upRead up
- Create a ticketCreate a ticket
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
Function render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
render() {
// If we have no data, and it's still loading, then return an empty div
if(this.state.terms === null && this.state.dataLoading === true){
return (<div></div>);
- Read upRead up
- Create a ticketCreate a ticket
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
Function updateDisplayData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
updateDisplayData(typedName, sort, showFilter, data, display) {
var filtered = [];
// First filters data.
if (showFilter !== null) {
- Read upRead up
- Create a ticketCreate a ticket
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"