AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Method getStudent has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getStudent($studentId){
        if($studentId === null || $studentId == ''){
            throw new \InvalidArgumentException('Missing student ID.');
        }

Severity: Minor
Found in class/DataProvider/Student/WebServiceDataProvider.php - About 1 hr to fix

Method homogenize has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function homogenize(&$query)
    {
        $query_list = explode(',', $query);

        $from[] = '/int\(\d+\)/iU';
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

Function searchListByDept has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    searchListByDept(e) {
        var dept = null;

        try {
            // Saves the dept that the user is looking for.
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

Function viewShowFilter has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    viewShowFilter(data, filter) {
        var filtered = [];

        for (var i = 0; i < data.length; i++) {
            var item = data[i];
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        return (
            <div className="panel panel-default">
                <div className="panel-body">
                    <div className="row">
Severity: Minor
Found in javascript/editCourses/courseEditor.jsx - About 1 hr to fix

Function render has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    render() {
        return (
            <div className="col-md-5 col-md-offset-1">
                <br /><br /><br />
                <div className="panel panel-default">
Severity: Minor
Found in javascript/manager/Manager.jsx - About 1 hr to fix

Method get has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function get()
    {
        $id = $_REQUEST['id'];
        $type = $_REQUEST['type'];
        // If the document's id is set then we're downloading the file
Severity: Minor
Found in class/Command/DocumentRest.php - About 1 hr to fix

Method getTotalRows has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTotalRows()
    {
        /**
         * if total_column is set, use it to get total rows
         */
Severity: Minor
Found in class/SubselectPager.php - About 1 hr to fix

Method getMessage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getMessage($id) {
        if(is_null($id) || !isset($id)) {
            throw new \InvalidArgumentException('Host ID is required.');
        }

Severity: Minor
Found in class/SubHostFactory.php - About 1 hr to fix

Method buildMessage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function buildMessage()
    {
        $this->to = explode(',', $this->emailSettings->getExceptionEmail());
        $this->subject = 'Uncaught Exception';

Severity: Minor
Found in class/Email/ExceptionEmail.php - About 1 hr to fix

Method addColumn has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function addColumn($column, $max_min = null, $as = null, $count = false, $distinct = false, $coalesce = null)
    {

        /****
         * What is this for?
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

    public function __construct(Student $student, $term, $location, $state, $country, Department $department, SubHost $sub_host, Supervisor $supervisor){
Severity: Major
Found in class/Internship.php - About 1 hr to fix

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

    public function __construct(string $term, string $description, int $availableOnTimestamp, int $censusDateTimestamp, int $startTimestamp, int $endTimestamp, int $undergradOverloadHours, int $gradOverloadHours)
Severity: Major
Found in class/Term.php - About 1 hr to fix

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

    public static function contractAffilationSelected($id)
    {
        /* Check if user should have access to folders since this method does not go through execute */
        if (!\Current_User::isLogged()) {
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING,
Severity: Minor
Found in class/Command/DocumentRest.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 plug has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function plug()
    {
    $tpl = array();
        $tpl['HOME_LINK']    = \PHPWS_Text::moduleLink('Menu', 'intern');
        $tpl['ADD_LINK']     = \PHPWS_Text::moduleLink('Add Student', 'intern', array('action' => 'ShowInternship'));
Severity: Minor
Found in class/UI/TopUI.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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function execute() {
        // Check permissions
        if(!\Current_User::allow('intern', 'create_internship')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'You do not have permission to create new internships.');
            \NQ::close();
Severity: Minor
Found in class/Command/AddInternship.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 post has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function post() {
        $code = $_REQUEST['code'];
        $census = $_REQUEST['census'];
        $descr = $_REQUEST['descr'];
        $available = $_REQUEST['available'];
Severity: Minor
Found in class/Command/TermRest.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 handleSave has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    handleSave() {
        if (this.refs.sub_address.value === ''||this.refs.sub_zip.value === ''||this.state.location === undefined) {
            this.setState({showError: true, warningMsg: "Please enter sub host address information."});
            return;
        }
Severity: Minor
Found in javascript/createInterface/HostBlock.jsx - 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 addTable has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function addTable($table, $as = null)
    {
        if (is_array($table)) {
            foreach ($table as $tbl_name) {
                $this->addTable($tbl_name);
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 parsePearCol has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function parsePearCol($info, $strip_name = false)
    {
        $setting = $GLOBALS['PHPWS_DB']['lib']->export($info);
        if (isset($info['flags'])) {
            if (stristr($info['flags'], 'multiple_key')) {
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

Severity
Category
Status
Source
Language