AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Function getOrder has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOrder($dbReady = false)
    {
        if (empty($this->order)) {
            return null;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 55 mins to fix

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 parseColumns has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function parseColumns($columns)
    {
        static $primary_keys = array();
        //$table = $this->tables[0];
        $table = $this->getSourceTable();
Severity: Minor
Found in class/SubselectDatabase.php - About 55 mins to fix

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 getRowTags has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getRowTags()
    {
          $tpl = array();
          $tpl['NAME']     = \PHPWS_Text::moduleLink($this->getName(), 'intern',
                              array('action' => 'showAffiliateEditView', 'affiliation_agreement_id' => $this->getId()));
Severity: Minor
Found in class/AffiliationAgreement.php - About 55 mins to fix

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 update has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function update($return_affected = false)
    {
        PHPWS_DB::touchDB();

        $table = $this->getTable(true);
Severity: Minor
Found in class/SubselectDatabase.php - About 55 mins to fix

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 exec has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function exec($ch = null)
    {

        if ($ch === null) {
            $this->rawResponse = curl_exec($this->curl);
Severity: Minor
Found in class/DataProvider/Curl.php - About 55 mins to fix

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 showStudentWarnings has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private function showStudentWarnings()
    {
        // Check if we have a student object. If we don't, then bail immediately.
        if(!isset($this->student)){
            return;
Severity: Minor
Found in class/InternshipView.php - About 55 mins to fix

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 buildSwiftMessage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function buildSwiftMessage($to, $fromAddress, $fromName, $subject, $content, $cc = NULL, $bcc = NULL){

        // Sanity checking
        if(!isset($to) || $to === null){
            throw new \InvalidArgumentException('\"To\" not set.');
Severity: Minor
Found in class/Email/Email.php - About 55 mins to fix

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 setSearch has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function setSearch()
    {
        $args = func_get_args();

        if (sizeof($args) == 1 && is_array($args[0])) {
Severity: Minor
Found in class/SubselectPager.php - About 55 mins to fix

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 extractTableName has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function extractTableName($sql_value)
    {
        $temp = explode(' ', trim($sql_value));

        if (!is_array($temp)) {
Severity: Minor
Found in class/SubselectDatabase.php - About 55 mins to fix

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 updateSequenceTable has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function updateSequenceTable()
    {
        $this->addColumn('id', 'max');

        $max_id = $this->select('one');
Severity: Minor
Found in class/SubselectDatabase.php - About 55 mins to fix

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 buildSwiftMessage has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected static function buildSwiftMessage($to, $fromAddress, $fromName, $subject, $content, $cc = NULL, $bcc = NULL){
Severity: Major
Found in class/Email/Email.php - About 50 mins to fix

Method __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Internship $internship, Student $student = null, WorkflowState $wfState, SubHost $host, Supervisor $supervisor, Term $term, $studentExistingCreditHours) {
Severity: Major
Found in class/InternshipView.php - About 50 mins to fix

Method saveFile has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function saveFile($id, $name, $fileName, $target_file, $type,
            $fileLongType)
Severity: Minor
Found in class/Command/DocumentRest.php - About 45 mins to fix

Function put has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function put() {
        $postarray = json_decode(file_get_contents('php://input'));
        $Id = $postarray->id;

        $db = Database::newDB();
Severity: Minor
Found in class/Command/HostRest.php - About 45 mins to fix

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 8 (exceeds 5 allowed). Consider refactoring.
Open

    render() {
        var ApproveData = null;
        if (this.state.approveData != null && this.state.hostData != null && this.state.conditionData != null) {
            ApproveData = this.state.approveData.map(function (host) {
                return (
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 45 mins to fix

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 handleSave has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    handleSave() {
        this.setState({editMode: false});

        var newStype = ReactDOM.findDOMNode(this.refs.savedStype).value.trim();
        var newDescr = ReactDOM.findDOMNode(this.refs.savedDescr).value.trim();
Severity: Minor
Found in javascript/editTerms/EditTerms.jsx - About 45 mins to fix

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

Avoid deeply nested control flow statements.
Open

                if (!item.auto_renew && expiration < 0) {
                    filtered.push(item);
                }
Severity: Major
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 45 mins to fix

Avoid deeply nested control flow statements.
Open

                if (item.host_approve_flag === 1) {
                    filtered.push(item);
                }
Severity: Major
Found in javascript/specialHost/ApproveHost.jsx - About 45 mins to fix

Method joinResult has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function joinResult($source_column, $join_table, $join_column, $content_column, $new_name=null, $searchable=false)
Severity: Minor
Found in class/SubselectPager.php - About 45 mins to fix

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Internship $i, Student $student = null, SubHost $host, Supervisor $supervisor, Term $term, $studentExistingCreditHours)
Severity: Minor
Found in class/EditInternshipFormView.php - About 45 mins to fix
Severity
Category
Status
Source
Language