AppStateESS/InternshipInventory

View on GitHub

Showing 379 of 6,675 total issues

Method process has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function process($arguments)
{
    $dump_data = false;

    array_shift($arguments);
Severity: Minor
Found in contrib/createFakeStudents.php - About 1 hr to fix

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

    render() {

        var dropdown;
        if(!this.state.domestic && !this.state.international) {
            dropdown = '';
Severity: Minor
Found in javascript/searchInterface/SearchInterface.jsx - About 1 hr to fix

Function render has 48 lines of code (exceeds 25 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>);
Severity: Minor
Found in javascript/createInterface/TermBlock.jsx - About 1 hr to fix

Method execute has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function execute()
    {
        // Get the list of future terms
        $terms = TermFactory::getFutureTermsAssoc();

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

Function viewShowFilter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    viewShowFilter(data, filter) {
        var filtered = [];
        for (var i = 0; i < data.length; i++) {
            var item = data[i];
            if (filter === 'condition') {
Severity: Minor
Found in javascript/specialHost/ApproveHost.jsx - About 1 hr 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 processArgs has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function processArgs($argc, $argv, &$args, &$switches)
{
    if($argc < count(array_keys($args)) + 1) {
        echo "USAGE: php {$argv[0]}";

Severity: Minor
Found in cli.php - About 1 hr 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 getTableColumns has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public function getTableColumns($fullInfo = false)
    {
        static $table_check = null;

        $table_compare = implode(':', $this->tables);
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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 generatePdf has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    private function generatePdf()
    {
        $this->pdf = new \setasign\Fpdi\Fpdi('P', 'mm', 'Letter');
        $h = $this->internship->getHost();
        $s = $this->internship->getSupervisor();
Severity: Minor
Found in class/InternshipContractPdfView.php - About 1 hr 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 check_args has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function check_args($argc, $argv, &$args, &$switches)
{
    if($argc < count(array_keys($args)) + 1) {
        echo "USAGE: php {$argv[0]}";

Severity: Minor
Found in contrib/cliCommon.php - About 1 hr 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 post has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function post($contractDir, $otherDir, $affiliationDir)
    {
        // List of known types taken from fileca$target_dir = $otherDir;binet. Only these accepted, update list of accept more.
        $known_documents = array('csv', 'doc', 'docx', 'odt', 'pdf', 'ppt', 'pptx', 'rtf',
            'tar', 'tgz', 'txt', 'xls', 'xlsx', 'xml', 'zip', 'gz', 'rar', 'ods', 'odp');
Severity: Minor
Found in class/Command/DocumentRest.php - About 1 hr to fix

Method createReport has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function createReport()
    {
        if ($this->class) {
            $methods = get_class_methods($this->class);
            if (in_array($this->report_row, $methods)) {
Severity: Minor
Found in class/SubselectPager.php - About 1 hr to fix

Function sortBy has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    sortBy(unsorted, typeOfSort) {
      var sorted = [];

      // Different logic for different types of sorts,
      // all utilizing sort function.
Severity: Minor
Found in javascript/affiliationAgreement/AffiliateList.jsx - About 1 hr to fix

Method getJoin has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getJoin()
    {
        if (empty($this->_join_tables)) {
            return null;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

Function onAdminCreate has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    onAdminCreate(username, department)
    {
        //var displayName = '';
        var displayData = this.state.displayData;
        var dept = this.state.deptData;
Severity: Minor
Found in javascript/editAdmin/editAdmin.jsx - About 1 hr to fix

Method getColumn has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getColumn($format = false)
    {
        if ($format) {
            if (empty($this->columns)) {
                //return $this->tables[0] . '.*';
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr to fix

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

    render() {
        var majorsDropdown;

        if(!this.state.undergrad && !this.state.graduate) {
            majorsDropdown = <MajorsDropDown formStyle='horizontal'/>;
Severity: Minor
Found in javascript/majorSelector/MajorSelector.jsx - About 1 hr to fix

Method display has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function display()
    {
        /* Check if user should have access to Affiliate Agreement page */
        if(!\Current_User::allow('intern', 'affiliation_agreement')){
            \NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, 'You do not have permission to add Affiliate Agreements.');
Severity: Minor
Found in class/UI/EditAgreementUI.php - About 1 hr to fix

Function get has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function get() {
        $db = \phpws2\Database::newDB();
        $pdo = $db->getPDO();

        if(!isset($_REQUEST['Waiting']) && !isset($_REQUEST['Condition'])){
Severity: Minor
Found in class/Command/HostRest.php - About 1 hr 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 createTableIndex has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function createTableIndex($column, $name = null, $unique = false)
    {
        if (!DB_ALLOW_TABLE_INDEX) {
            return false;
        }
Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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 getObjects has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function getObjects($class_name)
    {
        $items = null;
        $result = $this->select();

Severity: Minor
Found in class/SubselectDatabase.php - About 1 hr 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