Showing 142 of 174 total issues
Function handleSubmit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSubmit() {
var $ = require('jquery');
if (this.state.stripeLowValueWarning) {
Method store
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store($userId)
{
User::findWithPermission($userId);
$requestData = \Request::only(['reason', 'amount', 'return_path', 'stripeToken', 'ref']);
Function render
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
var dropdownOptions = [
{key:'', value:''},
{key:'consumables', value:'Consumables'},
Function correctImageRotation
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function correctImageRotation($filePath)
{
$exif_data = @exif_read_data($filePath);
//Auto image rotation
- 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 up
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
Schema::create('equipment', function(Blueprint $table)
{
$table->increments('id');
Method handle
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle()
{
$proposals = $this->proposalRepository->getUnprocessedFinishedProposals();
foreach ($proposals as $proposal) {
$this->info($proposal->title);
Method store
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function store()
{
$input = \Input::only('subject', 'message', 'send_to_all', 'recipient');
$this->emailNotificationValidator->validate($input);
Method recordPayment
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function recordPayment($reason, $userId, $source, $sourceId, $amount, $status = 'paid', $fee = 0.0, $ref = '', Carbon $paidDate = null)
Method destroy
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function destroy($userId, $id = null)
{
/**
* TODO: Check for and cancel pending sub charges
*/
Function updateSubPayment
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function updateSubPayment($paymentId, $userId, $status)
{
$payment = $this->paymentRepository->getById($paymentId);
$subCharge = $this->subscriptionChargeRepository->findCharge($userId);
- 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
Function handleSubmit
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSubmit: function(event) {
event.preventDefault();
this.setState({submitAttempt:true, requestInProgress:true});
Method reason
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function reason()
{
switch ($this->entity->reason) {
case 'subscription':
return 'Subscription';
Method setResults
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function setResults($proposalId, $result, $votesCast, $for, $against, $neutral, $abstentions, $quorum)
Method recordSubscriptionPayment
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public function recordSubscriptionPayment($userId, $source, $sourceId, $amount, $status = 'paid', $fee = 0.0, $ref = '', Carbon $paidDate = null)
Function validateData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function validateData()
{
//Verify the keyfob, device key and action
//Validate the action
- 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
Function handleBill
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function handleBill($amount, $reason, $user, $ref, $returnPath)
{
if (is_null($ref)) {
$ref = '';
}
- 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
Function ensureMembershipActive
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function ensureMembershipActive($userId)
{
/** @var User $user */
$user = $this->getById($userId);
- 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
Function handle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function handle()
{
//Close records that were left open
$records = $this->equipmentLogRepository->getActiveRecords();
foreach ($records as $log) {
- 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
Function update
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function update($boxId)
{
$userId = \Request::get('user_id');
if ($userId) {
- 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
Function fetchNextRecord
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function fetchNextRecord($userId, $device, $reason, \DateTime $finishedDate)
{
foreach ($this->logEntries as $entry) {
if (($entry['user_id'] == $userId) && ($entry['device'] == $device) && ($entry['reason'] == $reason)) {
if (($entry['started']->gt($finishedDate)) && ($entry['started']->diffInSeconds($finishedDate) <= 60)) {
- 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"