Showing 84 of 177 total issues
Function fieldsProvider
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fieldsProvider() {
return [
{
key: 'id',
displayable: () => false,
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
render(h, props) {
const defaultConfig = [
{
start: 0,
end: 0.75,
Method tasks
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function tasks(IntervalTasksRequest $request): JsonResponse
{
$requestData = Filter::process(Filter::getRequestFilterName(), $request->validated());
$timezone = Settings::scope('core')->get('timezone', 'UTC');
Method handle
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function handle(Client $client): int
{
if (Settings::scope('core')->get('instance')) {
echo 'Application already registered';
return 1;
File IntervalController.php
has 253 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace App\Http\Controllers\Api;
use App\Contracts\ScreenshotService;
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: (h, props) => {
return h(VueEditor, {
props: {
useMarkdownShortcuts: true,
editorToolbar: [
Method up
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
$user_role_id = 2;
$manager_role_id = 5;
$blocked_role_id = 255;
Function fieldsToFillProvider
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export function fieldsToFillProvider() {
return [
{
key: 'id',
displayable: () => false,
- 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 edit
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function edit(EditTaskRequest $request): JsonResponse
{
Filter::listen(
Filter::getRequestFilterName(),
static function (array $requestData) {
Function timePerProject
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
timePerProject: (state, getters) => {
return Object.keys(getters.intervals).reduce((result, userID) => {
const userEvents = getters.intervals[userID];
if (!userEvents) {
return result;
Function render
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: (h, props) => {
const data = [];
Object.keys(props.currentValue).forEach(k => {
props.currentValue[k].time = formatDurationString(+props.currentValue[k].duration);
data.push(props.currentValue[k]);
Method up
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::unprepared('
CREATE OR REPLACE VIEW `project_report` AS
SELECT
Method up
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::unprepared('
CREATE OR REPLACE VIEW `project_report` AS
SELECT
Function handle
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): int
{
if ($this->option('email')) {
$email = $this->option('email');
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function handle(Client $client): int
{
if (Settings::scope('core')->get('instance')) {
echo 'Application already registered';
return 1;
- 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 exports
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = () => {
console.log('Reading modules config file...');
const p = path.join(__dirname, '..', 'etc', 'modules.config.json');
if (!fs.existsSync(path.join(__dirname, '..', 'generated'))) {
Method process
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function process(Request $request): JsonResponse
{
$validator = Validator::make($request->all(), [
'email' => 'required|email',
'token' => 'required|string',
Method up
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function up()
{
DB::unprepared('
CREATE OR REPLACE VIEW `project_report` AS
SELECT
Method updateProjectSource
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function updateProjectSource()
{
$projectIds = DB::table(Property::getTableName())
->select('entity_id')
->where('entity_type', '=', Property::PROJECT_CODE)
Method total
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function total(Request $request): JsonResponse
{
$validationRules = [
'start_at' => 'required|date',
'end_at' => 'required|date',