Showing 200 of 693 total issues
Function SignatureForm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function SignatureForm({ signature, handleEdit }) {
const types = useMemo(() => resolveSignatureToTypes(signature), [signature]);
const handleSelect = useCallback((newType, nestedIndex) => {
const newTypes = types.map((type, index) => (index === nestedIndex ? newType : type));
- 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 TaskParamsModal
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const TaskParamsModal = NiceModal.create(({
taskService,
mode: defaultMode = 'none',
action = 'none',
}) => {
- 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 changePlaybookSolution
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const changePlaybookSolution = method => dispatch => {
axios
.post(
`/api/v1/playbooks/${method}`,
{
Function Editor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Editor(props) {
const {
value,
syntax,
onChange,
Function useEditorCursor
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useEditorCursor = editor => {
const handleChangeCursorSelection = useCallback(e => {
const { readOnly, canSendCursor } = editor.getRawOptions();
if (!canSendCursor) {
Function collectFinalRecord
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const collectFinalRecord = (acc, strRecord) => {
const record = parse(strRecord);
const { players } = acc;
let player;
Function isValidValueToSignature
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const isValidValueToSignature = (value, signature) => {
if (!signature) {
return false;
}
Function validateTaskName
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateTaskName = name => (dispatch, getState) => {
if (name.length < MIN_NAME_LENGTH || name.length > MAX_NAME_LENGTH) {
return;
}
Function useGameRoomSocketChannel
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useGameRoomSocketChannel = (pageName, machines) => {
const dispatch = useDispatch();
const useChat = useSelector(selectors.gameUseChatSelector);
Function useHover
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function useHover() {
const [hovering, setHovering] = useState(false);
const previousNode = useRef(null);
const handleMouseEnter = useCallback(() => {
Function FeedbackWidget
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FeedbackWidget() {
const dispatch = useDispatch();
const currentUserName = useSelector(currentUserNameSelector);
Function ArenaInfoWidget
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ArenaInfoWidget = () => {
const {
state,
taskCount,
taskSolvedCount,
Method call
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.call
original_stdout = $stdout
$stdout = StringIO.new
@execution_result = []
args_list = JSON.parse(File.read(File.join(__dir__, './check/asserts.json')))
Function reduceOriginalRecords
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const reduceOriginalRecords = (acc, record, index) => {
const {
players, records, chat: chatState, type: playbookType,
} = acc;
const { messages, users } = chatState;
- 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 ArenaStageStatus
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function ArenaStageStatus({
playerId,
matchList,
matchState,
}) {
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.run = function run(args = [], count) {
let output = '';
let oldConsole = console;
const fakeStream = new Writable();
- 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 call
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function call() {
global $execution_result;
$execution_result = [];
$args_list = json_decode(file_get_contents(__DIR__ . '/check/asserts.json'), true);
Function solution
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
func solution(a int64, b int64, c string, d float64, e bool, f map[string]string, g []string, h [][]string) int64 {
Method solution
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
public Integer solution(Integer a, Integer b, String c, Double d, Boolean e, Map<String, String> f, List<String> g,
List<List<String>> h) {
Method solution
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def solution(numerator, denominator, _string, _float, _bool, _hash, _list_str, _list_list_str)